Browse Source

员工管理

shish 1 year ago
parent
commit
3923ee6606

+ 4 - 1
app-ghs/controllers/LiveOrderController.php

@@ -59,7 +59,10 @@ class LiveOrderController extends BaseController
             $price = $info['price'] ?? 0;
             $customList[] = ['customId' => $customId, 'customName' => $customName, 'num' => $num, 'price' => $price];
         }
-        $params = ['product' => $product, 'customList' => $customList];
+        $staff = $this->shopAdmin;
+        $staffId = $staff->id ?? 0;
+        $staffName = $staff->name ?? '';
+        $params = ['product' => $product, 'customList' => $customList, 'staffId' => $staffId, 'staffName' => $staffName];
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {

+ 4 - 0
biz-ghs/live/classes/LiveOrderClass.php

@@ -39,6 +39,8 @@ class LiveOrderClass extends BaseClass
         $itemName = $product->name ?? '';
         $itemCover = $product->cover ?? '';
         $customList = $params['customList'];
+        $staffId = $params['staffId'] ?? 0;
+        $staffName = $params['staffName'] ?? '';
         $customNum = count($customList);
         $itemNum = 0;
         foreach ($customList as $custom) {
@@ -55,6 +57,8 @@ class LiveOrderClass extends BaseClass
             'customNum' => $customNum,
             'itemNum' => $itemNum,
             'orderSn' => $orderSn,
+            'staffId' => $staffId,
+            'staffName' => $staffName,
         ];
         self::add($liveData, true);
         $ids = array_column($customList, 'customId');