|
@@ -53,15 +53,17 @@ class Notify extends Api
|
|
|
if ($message['return_code'] === 'SUCCESS') { // return_code 表示通信状态,不代表支付状态
|
|
|
// 用户是否支付成功
|
|
|
if ($message ['result_code'] === 'SUCCESS') {
|
|
|
- $username = $user_model->where('id',$order['user_id'])->value('username');
|
|
|
+ $username = $user_model->where('id',$order['user_id'])->find();
|
|
|
$log_data = [
|
|
|
'user_id'=>$order['user_id'],
|
|
|
- 'username'=>$username,
|
|
|
+ 'username'=>$username['username'],
|
|
|
'money'=>$order['price'],
|
|
|
'desc'=>'商城购物支付',
|
|
|
'create_time'=>time()
|
|
|
];
|
|
|
$transaction_log_model->insert($log_data);
|
|
|
+ $sms_model = new Chuyutimedtask();
|
|
|
+ $sms_model->order_sms(['mobile'=>$username['mobile'],'score'=>$username['score']]);
|
|
|
$pay_model->save(['status'=>2,'pay_time'=>time()],['pay_no'=>$message['out_trade_no']]);
|
|
|
$order_model->save(['status'=>2],['pay_no'=>$message['out_trade_no']]);
|
|
|
// 用户支付失败
|