正在显示
1 个修改的文件
包含
14 行增加
和
3 行删除
@@ -34,7 +34,7 @@ class LoadController extends HomeBaseController | @@ -34,7 +34,7 @@ class LoadController extends HomeBaseController | ||
34 | dump($data); | 34 | dump($data); |
35 | foreach($data as $key1 => $vo){ | 35 | foreach($data as $key1 => $vo){ |
36 | //判断是否已经发送 | 36 | //判断是否已经发送 |
37 | - $send_vice = Db::name('send_vice')->where(array('order_id'=>$vo['o_id'],'collocation_id'=>$vo['id'],'time'=>$vo['order_about_time']))->find(); | 37 | + $send_vice = Db::name('send_vice')->where(array('order_id'=>$vo['o_id'],'collocation_id'=>$vo['id'],'time'=>$vo['order_about_time'],'type'=>1))->find(); |
38 | if(empty($send_vice)){ | 38 | if(empty($send_vice)){ |
39 | //模板消息 | 39 | //模板消息 |
40 | $templateId = '83NoWJ74UmI-DY_FwrDrTBx1iysu9__6fosB-eMFm78'; | 40 | $templateId = '83NoWJ74UmI-DY_FwrDrTBx1iysu9__6fosB-eMFm78'; |
@@ -53,8 +53,8 @@ class LoadController extends HomeBaseController | @@ -53,8 +53,8 @@ class LoadController extends HomeBaseController | ||
53 | $user2 = Db::name('user')->where('id',$vo['user_id'])->find(); | 53 | $user2 = Db::name('user')->where('id',$vo['user_id'])->find(); |
54 | $content = "【橙象保单】尊敬的用户,您有一份保单即将到期需要续费,请在保障截止日期前完成续保,否则保单将失效,保险单号$vo[insurance_num],请在".date('Y月m日d',$vo['order_about_time']+30*24*60*60)."之前续费。"; | 54 | $content = "【橙象保单】尊敬的用户,您有一份保单即将到期需要续费,请在保障截止日期前完成续保,否则保单将失效,保险单号$vo[insurance_num],请在".date('Y月m日d',$vo['order_about_time']+30*24*60*60)."之前续费。"; |
55 | $this->note($content,$user2['mobile']); | 55 | $this->note($content,$user2['mobile']); |
56 | - Db::name('send_vice')->insert(array('order_id'=>$vo['o_id'],'collocation_id'=>$vo['id'],'time'=>$vo['order_about_time'],'user_id'=>$vo['user_id'],'create_time'=>time())); | ||
57 | - Db::name('order')->where(['id'=>$vo['o_id']])->setInc('order_about_time',30*24*60*60); | 56 | + Db::name('send_vice')->insert(array('order_id'=>$vo['o_id'],'collocation_id'=>$vo['id'],'time'=>$vo['order_about_time'],'user_id'=>$vo['user_id'],'create_time'=>time(),'type'=>1)); |
57 | + //Db::name('order')->where(['id'=>$vo['o_id']])->setInc('order_about_time',30*24*60*60); | ||
58 | } | 58 | } |
59 | } | 59 | } |
60 | }else if($type == 2){ | 60 | }else if($type == 2){ |
@@ -63,6 +63,17 @@ class LoadController extends HomeBaseController | @@ -63,6 +63,17 @@ class LoadController extends HomeBaseController | ||
63 | $whereor = "o.status = 1 and o.order_expire_time < $time and o.order_about_time < ".($time-24*30*60*60)." or o.status = 3 and o.order_expire_time < $time or o.status = 3 and o.order_about_time < ".($time-24*30*60*60); | 63 | $whereor = "o.status = 1 and o.order_expire_time < $time and o.order_about_time < ".($time-24*30*60*60)." or o.status = 3 and o.order_expire_time < $time or o.status = 3 and o.order_about_time < ".($time-24*30*60*60); |
64 | $data = $orderInfoModel->selectData1($where,$whereor); | 64 | $data = $orderInfoModel->selectData1($where,$whereor); |
65 | dump($data); | 65 | dump($data); |
66 | + foreach($data as $key1 => $vo){ | ||
67 | + //判断是否已经发送 | ||
68 | + $send_vice = Db::name('send_vice')->where(array('order_id'=>$vo['o_id'],'collocation_id'=>$vo['id'],'time'=>$vo['order_about_time'],'type'=>2))->find(); | ||
69 | + if(empty($send_vice)){ | ||
70 | + //短信 | ||
71 | + $user2 = Db::name('user')->where('id',$vo['user_id'])->find(); | ||
72 | + $content = "【橙象保单】尊敬的用户,您有一份保单已经失效,保险单号$vo[insurance_num]。"; | ||
73 | + $this->note($content,$user2['mobile']); | ||
74 | + Db::name('send_vice')->insert(array('order_id'=>$vo['o_id'],'collocation_id'=>$vo['id'],'time'=>$vo['order_about_time'],'user_id'=>$vo['user_id'],'create_time'=>time(),'type'=>2)); | ||
75 | + } | ||
76 | + } | ||
66 | } | 77 | } |
67 | } | 78 | } |
68 | public function template($templateId,$data,$url=null,$openid){ | 79 | public function template($templateId,$data,$url=null,$openid){ |
-
请 注册 或 登录 后发表评论