One-day-學習筆記-商品成交時傳送簡訊

來源:互聯網
上載者:User
                           個人學習筆記(one)

根據需求:商品成交時傳送簡訊

html代碼省略.....

Model代碼省略.....

 1/* 2     * ------------------------------------------------- 3     * 修改狀態 public  4     * Author: lzp Time:2016-05-27 5     * ------------------------------------------------- 6*/ 7 8publicfunction changeStateAction() { 9$id = $_REQUEST['id'];10$result = $this->changeConfirmState($id);11if ($result) {12$this->success("修改成功");13         } else {14$this->error("修改失敗");15        }16    }1718privatefunction changeConfirmState($id) {19$reg = $this->priceModel->selectPrice(['id'=>['eq', $id]]);20$rel = $this->demandModel->selectDemand(['id'=>['eq',$reg[0]['demand_id']]]);21$demand_id     = $reg[0]['demand_id'];22$reg['demand'] = $this->priceModel->selectPrice(['demand_id'=>['eq',$demand_id]]);23foreach ($reg['demand'] as$key => $value){24if($value['phone'] == $reg[0]['phone']){25unset($reg['demand'][$key]);26            }else{27$new[] = $value['phone'];28           }29        }31$new = ['0'=>'136********'];32if((time()-strtotime($rel[0]['create_time']))> 86400){33echo "";34die;35         }elseif(strtotime($rel[0]['finish_time'])>0){36echo "";37die;38         }else{39$data_demand      = [ 'is_available' => 2, 'finish_time'  => date("Y-m-d H:i:s") ];40$result['Price']  = $this->priceModel->savePrice( ['id'=>['eq',$id]], ['state'=>2] );41$result['Demadn'] = $this->demandModel->saveDemand(['id'=>['eq',$reg[0]['demand_id']]] , $data_demand);42$mobile = implode(",", $new);43$content = "此條需求已成交,下次再來喲!";44             smsApp($mobile,$content); //發簡訊45return$result;46        }47     }

以上就介紹了One-day-學習筆記-商品成交時傳送簡訊,包括了傳送簡訊,one方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.