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

去除保险时间字段

... ... @@ -305,10 +305,13 @@ class FormController extends WeChatBaseController
$data3['collocation_id'] = $param['id'];
$data3['time'] = $array1['expire_time']-($i*365*24*60*60)-(30*24*60*60);
$data4[] = $data3;
}else{
$data3['time'] = $param['payment_time'];
$data4[] = $data3;
}
}
Db::name('send')->insertAll($data4);
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']));
$array3 = array('order_expire_time'=>$array1['expire_time'],'order_about_time'=>$data4[count($data4)-1]['time'],'order_expire_time2'=>time()+(365*24*60*60));
Db::name('order')->where(array('collocation_id'=>$param['id'],'user_id'=>$user_id,'status'=>3))->update($array3);
$arr['code'] = 20000;
$arr['msg'] = '更新成功!';
return json_encode($arr);
... ...
... ... @@ -92,11 +92,26 @@ class PayController extends HomeBaseController
// 用户是否支付成功
if ($successful) {
Db::name('order_num')->insert(array('user_id'=>$order['user_id'],'create_time'=>time()));
$data4 = [];
$payment_time = $collocation['payment_time'];
for($i=0;$i<$payment_time;$i++){
if($collocation['expire_time']-($i*365*24*60*60)-(30*24*60*60)>time()){
$data3['user_id'] = $order['user_id'];
$data3['order_id'] = $order['id'];
$data3['collocation_id'] = $collocation['id'];
$data3['time'] = $collocation['expire_time']-($i*365*24*60*60)-(30*24*60*60);
$data4[] = $data3;
}else{
$data3['time'] = $collocation['expire_time']-(30*24*60*60);
$data4[] = $data3;
}
}
$update['pay_time']=time();
//未支付状态则修改为已经支付状态
$update['status'] = 3;
$update['order_expire_time']=$collocation['expire_time'];
$update['order_about_time']=$collocation['expire_time']-(30*24*60*60);
$update['order_about_time']=$data4[count($data4)-1]['time'];
$update['order_expire_time2']=time()+(365*24*60*60);
//推送模板消息
$templateId = 'iZwqjrOt7NCILnI0zkayK59y4jUXmnmfmROERWq-NEw';
$data1 = array(
... ...