作者 王晓刚
1 个管道 的构建 通过 耗费 2 秒

去除保险时间字段

@@ -305,10 +305,13 @@ class FormController extends WeChatBaseController @@ -305,10 +305,13 @@ class FormController extends WeChatBaseController
305 $data3['collocation_id'] = $param['id']; 305 $data3['collocation_id'] = $param['id'];
306 $data3['time'] = $array1['expire_time']-($i*365*24*60*60)-(30*24*60*60); 306 $data3['time'] = $array1['expire_time']-($i*365*24*60*60)-(30*24*60*60);
307 $data4[] = $data3; 307 $data4[] = $data3;
  308 + }else{
  309 + $data3['time'] = $param['payment_time'];
  310 + $data4[] = $data3;
308 } 311 }
309 } 312 }
310 - Db::name('send')->insertAll($data4);  
311 - Db::name('order')->where(array('collocation_id'=>$param['id'],'user_id'=>$user_id,'status'=>3))->update(array('order_expire_time'=>$array1['expire_time'],'order_about_time'=>$data4[count($data4)-1]['time'])); 313 + $array3 = array('order_expire_time'=>$array1['expire_time'],'order_about_time'=>$data4[count($data4)-1]['time'],'order_expire_time2'=>time()+(365*24*60*60));
  314 + Db::name('order')->where(array('collocation_id'=>$param['id'],'user_id'=>$user_id,'status'=>3))->update($array3);
312 $arr['code'] = 20000; 315 $arr['code'] = 20000;
313 $arr['msg'] = '更新成功!'; 316 $arr['msg'] = '更新成功!';
314 return json_encode($arr); 317 return json_encode($arr);
@@ -92,11 +92,26 @@ class PayController extends HomeBaseController @@ -92,11 +92,26 @@ class PayController extends HomeBaseController
92 // 用户是否支付成功 92 // 用户是否支付成功
93 if ($successful) { 93 if ($successful) {
94 Db::name('order_num')->insert(array('user_id'=>$order['user_id'],'create_time'=>time())); 94 Db::name('order_num')->insert(array('user_id'=>$order['user_id'],'create_time'=>time()));
  95 + $data4 = [];
  96 + $payment_time = $collocation['payment_time'];
  97 + for($i=0;$i<$payment_time;$i++){
  98 + if($collocation['expire_time']-($i*365*24*60*60)-(30*24*60*60)>time()){
  99 + $data3['user_id'] = $order['user_id'];
  100 + $data3['order_id'] = $order['id'];
  101 + $data3['collocation_id'] = $collocation['id'];
  102 + $data3['time'] = $collocation['expire_time']-($i*365*24*60*60)-(30*24*60*60);
  103 + $data4[] = $data3;
  104 + }else{
  105 + $data3['time'] = $collocation['expire_time']-(30*24*60*60);
  106 + $data4[] = $data3;
  107 + }
  108 + }
95 $update['pay_time']=time(); 109 $update['pay_time']=time();
96 //未支付状态则修改为已经支付状态 110 //未支付状态则修改为已经支付状态
97 $update['status'] = 3; 111 $update['status'] = 3;
98 $update['order_expire_time']=$collocation['expire_time']; 112 $update['order_expire_time']=$collocation['expire_time'];
99 - $update['order_about_time']=$collocation['expire_time']-(30*24*60*60); 113 + $update['order_about_time']=$data4[count($data4)-1]['time'];
  114 + $update['order_expire_time2']=time()+(365*24*60*60);
100 //推送模板消息 115 //推送模板消息
101 $templateId = 'iZwqjrOt7NCILnI0zkayK59y4jUXmnmfmROERWq-NEw'; 116 $templateId = 'iZwqjrOt7NCILnI0zkayK59y4jUXmnmfmROERWq-NEw';
102 $data1 = array( 117 $data1 = array(