...
|
...
|
@@ -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(
|
...
|
...
|
|