|
|
@@ -465,7 +465,7 @@ class PaymentService extends BaseService
|
|
|
// 充值订单
|
|
|
if ($scene == 'vip') {
|
|
|
$orderInfo = OrderModel::with(['vip'])->where(['order_no' => $orderNo, 'mark' => 1])
|
|
|
- ->select(['id as order_id', 'user_id','goods_id','expired_at', 'order_no', 'total as pay_money', 'pay_at as pay_time', 'status'])
|
|
|
+ ->select(['id as order_id', 'user_id','goods_id','expired_at', 'order_no', 'total as pay_money', 'pay_at as pay_time','remark', 'status'])
|
|
|
->first();
|
|
|
$orderStatus = isset($orderInfo['status']) ? $orderInfo['status'] : 0;
|
|
|
// 验证订单
|
|
|
@@ -492,7 +492,7 @@ class PaymentService extends BaseService
|
|
|
} // 保证金退款
|
|
|
else if ($scene == 'refund') {
|
|
|
$orderInfo = OrderModel::where(['order_no' => $orderNo, 'mark' => 1])
|
|
|
- ->select(['id as order_id', 'user_id', 'order_no', 'total as pay_money', 'pay_at as pay_time', 'refund_status as status'])
|
|
|
+ ->select(['id as order_id', 'user_id', 'order_no', 'total as pay_money','remark', 'pay_at as pay_time', 'refund_status as status'])
|
|
|
->first();
|
|
|
$orderStatus = isset($orderInfo['status']) ? $orderInfo['status'] : 0;
|
|
|
// 验证订单
|
|
|
@@ -532,6 +532,7 @@ class PaymentService extends BaseService
|
|
|
$vipInfo = isset($orderInfo['vip'])? $orderInfo['vip'] : [];
|
|
|
$vipType = isset($vipInfo['type'])? $vipInfo['type'] : 0;
|
|
|
$expiredAt = isset($orderInfo['expired_at'])? $orderInfo['expired_at'] : '';
|
|
|
+ $remark = isset($orderInfo['remark']) && $orderInfo['remark']? $orderInfo['remark'] : '购买VIP会员';
|
|
|
if(empty($vipInfo) || $expiredAt <= date('Y-m-d H:i:s') || $vipType<=0){
|
|
|
DB::rollBack();
|
|
|
$this->error = 'VIP参数错误';
|
|
|
@@ -550,6 +551,23 @@ class PaymentService extends BaseService
|
|
|
$this->error = 2639;
|
|
|
return false;
|
|
|
}
|
|
|
+ // 账单记录
|
|
|
+ $log = [
|
|
|
+ 'user_id'=>$orderUserId,
|
|
|
+ 'source_order_no'=> $orderNo,
|
|
|
+ 'type'=> 1,
|
|
|
+ 'money'=> $price,
|
|
|
+ 'date'=>date('Y-m-d'),
|
|
|
+ 'create_time'=>time(),
|
|
|
+ 'remark'=> $remark,
|
|
|
+ 'status'=> 1,
|
|
|
+ 'mark'=>1
|
|
|
+ ];
|
|
|
+ if(!AccountLogModel::insertGetId($log)){
|
|
|
+ $this->error = 2635;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
default:
|
|
|
DB::rollBack();
|