one-day-Study notes-send SMS when goods are sold, one-day-study notes _php Tutorials

Source: Internet
Author: User

one-day-Study notes-send SMS when goods are sold, one-day-study notes


Individual Learning Notes (one)

On demand: Send SMS when goods are sold

HTML code omitted .....

Model code omitted .....

1     /*2      * -------------------------------------------------3 * Modify State Public4 * AUTHOR:LZP time:2016-05-275      * -------------------------------------------------6      */7 8      Public functionchangestateaction () {9         $id=$_request[' ID '];Ten         $result=$this->changeconfirmstate ($id); One         if($result) { A             $this->success ("Modified successfully"); -}Else { -             $this->error ("Modify failed"); the         } -     } -  -     Private functionChangeconfirmstate ($id) { +         $reg=$this->pricemodel->selectprice ([' id ' =>[' eq ',$id]]); -         $rel=$this->demandmodel->selectdemand ([' id ' =>[' eq ',$reg[0] [' demand_id ']]]); +         $demand _id=$reg[0] [' demand_id ']; A         $reg[' demand '] =$this->pricemodel->selectprice ([' demand_id ' =>[' eq ',$demand _id]]); at         foreach($reg[' demand '] as $key=$value){ -            if($value[' phone '] = =$reg[0] [' Phone ']){ -                unset($reg[' demand '] [$key]); -}Else{ -                $new[] =$value[' Phone ']; -            } in         } to         $new= [' 0 ' = ' 136******** ']; +         if(( Time()-Strtotime($rel[0] [' Create_time '])) > 86400){ -             Echo""; the              die; *}Else if(Strtotime($rel[0] [' Finish_time ']) >0){ $             Echo"";Panax Notoginseng              die; -}Else{ the             $data _demand= [' is_available ' = = 2, ' finish_time ' =Date("Y-m-d h:i:s") ]; +             $result[' price '] =$this->pricemodel->saveprice ([' id ' =>[' eq ',$id]], [' State ' =>2] ); A             $result[' demadn '] =$this->demandmodel->savedemand ([' id ' =>[' eq ',$reg[0] [' demand_id ']] ,$data _demand); the             $mobile=implode(",",$new); +             $content= "This demand has been sold, next time come yo!"; -Smsapp ($mobile,$content); Send SMS $             return $result; $         } -}

http://www.bkjia.com/PHPjc/1125061.html www.bkjia.com true http://www.bkjia.com/PHPjc/1125061.html techarticle one-day-Study notes-send SMS when goods are sold, one-day-study notes Individual learning notes (one) On demand: Send SMS HTML code omitted when goods are sold ..... Model code omitted ....

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.