gorden пре 4 месеци
родитељ
комит
395dd51184

+ 5 - 2
app/admin/controller/order/WholeController.php

@@ -278,7 +278,7 @@ class WholeController extends Curd
 
         $order = Order::where('order_id', $orderId)->first();
         $payDetail = PayDetail::where('join_pay_order_id', $order->order_groupby)
-            ->select('pay_id', 'pay_category', 'pay_prepayid','pay_paytimes')
+            ->select('pay_id', 'pay_category', 'pay_prepayid','pay_paytimes','pay_status')
             ->first();
 
         if(!empty($payDetail->pay_prepayid)){
@@ -461,7 +461,7 @@ class WholeController extends Curd
                 $params['order_express_type'] = '配送';
                 // 入配送
                 $this->saveExpress($params);
-            }else if($params['delivery'] = 'PICKUP'){
+            }else if($params['delivery'] == 'PICKUP'){
                 $premises = SysDept::where('dept_name', $params['dept_premises_id'])->first();
                 $params['order_express_type'] = '自提';
                 if(!$premises){
@@ -523,6 +523,7 @@ class WholeController extends Curd
             return json_success('创建订单成功');
         } catch (\Exception $e) {
             Db::rollBack();
+            dump($e->getFile().'|'.$e->getLine());
             dump($e->getMessage());
             return json_fail('创建订单失败');
         }
@@ -622,6 +623,8 @@ class WholeController extends Curd
 
             PayDetail::insert($data);
         } catch (\Exception $e) {
+            dump(111);
+            dump($e->getMessage());
             throw new BusinessException('创建支付记录失败');
         }
     }

+ 57 - 0
app/admin/service/goods/GoodsService.php

@@ -634,6 +634,20 @@ class GoodsService
                 }
             }
 
+            $data['express_json'] = [];
+            if(!empty($data['goods_express_json'])){
+                $goodsExpressJson = json_decode($data['goods_express_json'],true);
+                if(isset($goodsExpressJson['express']) && $goodsExpressJson['express'] ==  'Y'){
+                    $data['express_json'][] = 'express';
+                }
+                if(isset($goodsExpressJson['self']) && $goodsExpressJson['self'] ==  'Y'){
+                    $data['express_json'][] = 'self';
+                }
+                if(isset($goodsExpressJson['arrival']) && $goodsExpressJson['arrival'] ==  'Y'){
+                    $data['express_json'][] = 'arrival';
+                }
+            }
+
             $data['appointment_times'] = [];
             if ($data['is_support_appointment'] == 'Y' && isset($extendJson['dates'])) {
                 $data['dates'] = $extendJson['dates'] ?? [];
@@ -1233,6 +1247,27 @@ class GoodsService
             $model->creator_user_id = JwtToken::getCurrentId();
             $model->goods_addtimes = time();
             $model->goods_updatetimes = time();
+            // {"express":"Y","self":"Y","arrival":"Y"}
+            $expressJson = [];
+            if (!empty($params['express_json'])){
+                if(in_array('express',$params['express_json'])){
+                    $expressJson['express'] = 'Y';
+                }else{
+                    $expressJson['express'] = 'N';
+                }
+                if (in_array('self',$params['express_json'])){
+                    $expressJson['self'] = 'Y';
+                }else{
+                    $expressJson['self'] = 'N';
+                }
+                if (in_array('arrival',$params['express_json'])){
+                    $expressJson['arrival'] = 'Y';
+                }else{
+                    $expressJson['arrival'] = 'N';
+                }
+
+                $model->goods_express_json = json_encode($expressJson);
+            }
 
             if (!empty($params['is_support_appointment']) && $params['is_support_appointment'] == 'Y' && !empty($params['appointment_times']) && $params['goods_category'] != 'TRAVEL') {
                 $times = [];
@@ -1692,6 +1727,27 @@ class GoodsService
                 $redis->sadd($newKey, $data['goods_id']);
             }
 
+            $expressJson = [];
+            if (!empty($params['express_json'])){
+                if(in_array('express',$params['express_json'])){
+                    $expressJson['express'] = 'Y';
+                }else{
+                    $expressJson['express'] = 'N';
+                }
+                if (in_array('self',$params['express_json'])){
+                    $expressJson['self'] = 'Y';
+                }else{
+                    $expressJson['self'] = 'N';
+                }
+                if (in_array('arrival',$params['express_json'])){
+                    $expressJson['arrival'] = 'Y';
+                }else{
+                    $expressJson['arrival'] = 'N';
+                }
+
+                $data['goods_express_json'] = json_encode($expressJson);
+            }
+
             if (!empty($params['is_support_appointment']) && $params['is_support_appointment'] == 'Y' && !empty($params['appointment_times']) && $params['goods_category'] != 'TRAVEL') {
                 $attributeJson = [];
                 if (!empty($row->goods_attribute_json)) {
@@ -1798,6 +1854,7 @@ class GoodsService
                 } elseif (empty($data['goods_attribute_json'])) {
                     $data['goods_attribute_json'] = [];
                 }
+                dump($data['goods_attribute_json']);
                 $data['goods_attribute_json']['premisses'] = $params['goods_premisses'];
                 $data['goods_attribute_json'] = json_encode($data['goods_attribute_json']);
             }