基于php实现商品成交时发送短信功能.doc

上传人:F****n 文档编号:69464640 上传时间:2019-01-13 格式:DOCX 页数:3 大小:17.92KB
返回 下载 相关 举报
基于php实现商品成交时发送短信功能.doc_第1页
第1页 / 共3页
基于php实现商品成交时发送短信功能.doc_第2页
第2页 / 共3页
基于php实现商品成交时发送短信功能.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《基于php实现商品成交时发送短信功能.doc》由会员分享,可在线阅读,更多相关《基于php实现商品成交时发送短信功能.doc(3页珍藏版)》请在金锄头文库上搜索。

1、基于PHP实现商品成交时发送短信功能最近做了一个项目,其中有需求,要求我们实现此功能:商品成交时发送短信,下面贴出核心代码,方面大家以后学习。html代码省略.Model代码省略.核心代码如下所示:/* -* 修改状态 public* Author: lzp Time:-* -*/public function changeStateAction $id = $_REQUESTid;$result = $this-changeConfirmState($id);if ($result) $this-success(修改成功); else $this-error(修改失败);private fu

2、nction changeConfirmState($id) $reg = $this-priceModel-selectPrice(id=eq, $id);$rel = $this-demandModel-selectDemand(id=eq,$regdemand_id);$demand_id = $regdemand_id;$regdemand = $this-priceModel-selectPrice(demand_id=eq,$demand_id);foreach ($regdemand as $key = $value)if($valuephone = $regphone)unse

3、t($regdemand$key);else$new = $valuephone;$new = =*;if(time -strtotime($relcreate_time) )echo alert(已超时!);history.back ;die;else if(strtotime($relfinish_time)echo alert(已成交!);history.back ;die;else$data_demand = is_available = , finish_time = date(Y-m-d H:i:s) ;$resultPrice = $this-priceModel-savePrice( id=eq,$id, state= );$resultDemadn = $this-demandModel-saveDemand(id=eq,$regdemand_id , $data_demand);$mobile = implode(, $new);$content = 此条需求已成交,下次再来哟!;smsApp($mobile,$content); /发短信return $result;以上代码是给大家贴的核心的代码,代码还算简单,所以没给大家写太多的注释

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 事务文书

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号