以上代码是小编给大家贴的核心的代码
分类:彩世界开奖app苹果下载-编程

以上代码是小编给大家贴的核心的代码。最近做了一个项目,其中有需求,要求我们实现此功能:商品成交时发送短信,下面小编贴出核心代码,方面大家以后学习。

html代码省略.....

Model代码省略.....

核心代码如下所示:

 /** -------------------------------------------------* 修改状态 public * Author: lzp Time:--* -------------------------------------------------*/public function changeStateAction() {$id = $_REQUEST['id'];$result = $this->changeConfirmState {$this->success;} else {$this->error;}}private function changeConfirmState {$reg = $this->priceModel->selectPrice;$rel = $this->demandModel->selectDemand(['id'=>['eq',$reg[]['demand_id']]]);$demand_id = $reg[]['demand_id'];$reg['demand'] = $this->priceModel->selectPrice(['demand_id'=>['eq',$demand_id]]);foreach ($reg['demand'] as $key => $value){if($value['phone'] == $reg[]['phone']){unset;}else{$new[] = $value['phone'];}}$new = [''=>'********'];if-strtotime($rel[]['create_time']))> ){echo "alert;history.back();";die;}else if(strtotime($rel[]['finish_time'])>){echo "alert;history.back();";die;}else{$data_demand = [ 'is_available' => , 'finish_time' => date ];$result['Price'] = $this->priceModel->savePrice( ['id'=>['eq',$id]], ['state'=>] );$result['Demadn'] = $this->demandModel->saveDemand(['id'=>['eq',$reg[]['demand_id']]] , $data_demand);$mobile = implode;$content = "此条需求已成交,下次再来哟!";smsApp; //发短信return $result;}} 

以上代码是小编给大家贴的核心的代码,代码还算简单,所以没给大家写太多的注释,大家在参考过程中遇到任何问题,欢迎给我留言,小编会及时回复大家的,在此非常感谢大家对脚本之家网站的支持!

本文由彩世界开奖发布于彩世界开奖app苹果下载-编程,转载请注明出处:以上代码是小编给大家贴的核心的代码

上一篇:再在learn/里建立一个目录smarty/ 下一篇:本文实例讲述了Smarty变量用法
猜你喜欢
热门排行
精彩图文