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