...
|
...
|
@@ -34,7 +34,7 @@ class LoadController extends HomeBaseController |
|
|
dump($data);
|
|
|
foreach($data as $key1 => $vo){
|
|
|
//判断是否已经发送
|
|
|
$send_vice = Db::name('send_vice')->where(array('order_id'=>$vo['o_id'],'collocation_id'=>$vo['id'],'time'=>$vo['order_about_time']))->find();
|
|
|
$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();
|
|
|
if(empty($send_vice)){
|
|
|
//模板消息
|
|
|
$templateId = '83NoWJ74UmI-DY_FwrDrTBx1iysu9__6fosB-eMFm78';
|
...
|
...
|
@@ -53,8 +53,8 @@ class LoadController extends HomeBaseController |
|
|
$user2 = Db::name('user')->where('id',$vo['user_id'])->find();
|
|
|
$content = "【橙象保单】尊敬的用户,您有一份保单即将到期需要续费,请在保障截止日期前完成续保,否则保单将失效,保险单号$vo[insurance_num],请在".date('Y月m日d',$vo['order_about_time']+30*24*60*60)."之前续费。";
|
|
|
$this->note($content,$user2['mobile']);
|
|
|
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()));
|
|
|
Db::name('order')->where(['id'=>$vo['o_id']])->setInc('order_about_time',30*24*60*60);
|
|
|
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));
|
|
|
//Db::name('order')->where(['id'=>$vo['o_id']])->setInc('order_about_time',30*24*60*60);
|
|
|
}
|
|
|
}
|
|
|
}else if($type == 2){
|
...
|
...
|
@@ -63,6 +63,17 @@ class LoadController extends HomeBaseController |
|
|
$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);
|
|
|
$data = $orderInfoModel->selectData1($where,$whereor);
|
|
|
dump($data);
|
|
|
foreach($data as $key1 => $vo){
|
|
|
//判断是否已经发送
|
|
|
$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();
|
|
|
if(empty($send_vice)){
|
|
|
//短信
|
|
|
$user2 = Db::name('user')->where('id',$vo['user_id'])->find();
|
|
|
$content = "【橙象保单】尊敬的用户,您有一份保单已经失效,保险单号$vo[insurance_num]。";
|
|
|
$this->note($content,$user2['mobile']);
|
|
|
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));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
public function template($templateId,$data,$url=null,$openid){
|
...
|
...
|
|