Просмотр исходного кода

增加商品原价,订单列表增加客户信息

林海涛 1 год назад
Родитель
Сommit
ccad629c8b

+ 3 - 0
app/workerapi/lists/shops/ShopGoodLists.php

@@ -26,6 +26,7 @@ class ShopGoodLists extends BaseWorkerDataLists implements ListsSearchInterface
 
     public function lists(): array
     {
+        record_sql();
         $lists = ShopGoods::with(['goodSpecsInventory'=>function(Query $query){
             $query->field(['id','shop_goods_id','remaining_inventory','service_fee','service_total']);
         }])
@@ -41,6 +42,8 @@ class ShopGoodLists extends BaseWorkerDataLists implements ListsSearchInterface
             ->each(function($item){
                 $item['remaining_inventory'] =(int) $item->goodSpecsInventory()->sum('remaining_inventory');
                 $item['service_fee'] = $item->goodSpecsInventory()->min('service_fee');
+                $serviceItem = $item->goodSpecsInventory()->where('service_fee',$item['service_fee'])->find()->toArray();
+                $item['service_total'] = floatval($serviceItem['service_total'] ?? 0);
                 unset($item['goodSpecsInventory']);
             })
             ->toArray();

+ 1 - 1
app/workerapi/lists/shops/ShopOrderLists.php

@@ -28,7 +28,7 @@ class ShopOrderLists extends BaseWorkerDataLists
             }]);
         }])
             ->where($this->querySearch())
-            ->field('id, sn, pay_time, paw_way, pay_status, refund_status, create_time, amount_total, order_amount,shop_order_type')
+            ->field('id, sn, real_name, mobile, address, pay_time, paw_way, pay_status, refund_status, create_time, amount_total, order_amount,shop_order_type')
             ->append(['pay_way_text','pay_status_text','refund_status_text'])
             ->limit($this->limitOffset, $this->limitLength)
             ->order('id', 'desc')