shish преди 5 години
родител
ревизия
20a139de2c
променени са 3 файла, в които са добавени 35 реда и са изтрити 5 реда
  1. 17 5
      app/ghs/controllers/OrderController.php
  2. 7 0
      biz-ghs/custom/classes/CustomClass.php
  3. 11 0
      sql.sql

+ 17 - 5
app/ghs/controllers/OrderController.php

@@ -6,6 +6,7 @@ use biz\merchant\services\ExpressService;
 use biz\merchant\services\MerchantAssetService;
 use biz\merchant\services\MerchantExtendService;
 use biz\merchant\services\MerchantService;
+use bizGhs\custom\classes\CustomClass;
 use bizGhs\merchant\services\ShopService;
 use biz\order\classes\OrderSendClass;
 use bizGhs\order\classes\OrderClass;
@@ -27,13 +28,26 @@ class OrderController extends BaseController
     //商城下单操作 shish 2021.1.14
     public function actionCreateOrder()
     {
-
+        $post = Yii::$app->request->post();
         //供货商端口:员工开单、客户开单
+        $adminId = $this->adminId;
+        $shopId = $this->shopId;
+        if(!empty($shopId)){
+            //供货商端员工开单
+            $post['customId'] = $post['customId'] ?? 0;
+            $post['adminId'] = $adminId;
+            $post['userId'] = 0;
+        }else{
+            //供货商端客户开单
+            $post['userId'] = $adminId;
+            $post['adminId'] = 0;
+            $post['customId'] = CustomClass::addCustom();
+        }
 
         //零售端口:员工采购
 
-        $post = Yii::$app->request->post();
-        $post['adminId'] = 0;
+
+
         $post['payWay'] = $this->isWx == true ? 0 : 1;
         $post['ghsId'] = $this->ghsId;
         $post['shopId'] = 0;
@@ -59,8 +73,6 @@ class OrderController extends BaseController
         ];
         //OrderGoodsService::add($data);//创建订单商品列表
         util::success(['orderSn' => $orderSn, 'totalPrice' => $actPrice]);
-
-
     }
 
     //下单要用到的相关信息 shish 2019.12.6

+ 7 - 0
biz-ghs/custom/classes/CustomClass.php

@@ -53,4 +53,11 @@ class CustomClass extends BaseClass
         }
     }
 
+    //创建客户 shish 2021.1.18
+    public static function addCustom()
+    {
+
+    }
+
+
 }

+ 11 - 0
sql.sql

@@ -586,7 +586,10 @@ ALTER TABLE `xhPurchase` ADD `itemPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' CO
 ALTER TABLE `xhPurchase` ADD `prePrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '应付款,原价,未修改价格,打折前' AFTER `itemPrice`;
 ALTER TABLE `xhPurchase` ADD `actPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实际付款,实价,修改后价格,打折后' AFTER `prePrice`;
 ALTER TABLE `xhPurchase` ADD remark VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '备注' AFTER `debt`;
+
+
 =======
+== lqh 2021-1-17
 CREATE TABLE `xhGhsStockRecord` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
   `ghsId` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '供货商ID',
@@ -607,3 +610,11 @@ ALTER TABLE `xhItem`
 ADD COLUMN `bigUnit`  smallint(6) NOT NULL DEFAULT 0 COMMENT '大单位' AFTER `unit`,
 ADD COLUMN `smallUnit`  smallint(6) NOT NULL DEFAULT 0 COMMENT '小单位' AFTER `bigUnit`;
 
+=====
+== shish 2021-1-18
+ALTER TABLE xhGhsOrder MODIFY `adminId` INT(11) NOT NULL DEFAULT '0' COMMENT '客户id,对应表xhGhsAdmin id字段';
+ALTER TABLE xhGhsOrder ADD staffId INT NOT NULL DEFAULT 0 COMMENT '员工id,对应表xhGhsAdmin id字段' AFTER adminId;
+ALTER TABLE xhGhsOrder MODIFY `adminId` INT NOT NULL DEFAULT 0 COMMENT '员工id,对应xhGhsAdmin id字段';
+ALTER TABLE xhGhsOrder CHANGE `staffId` `userId` INT NOT NULL DEFAULT 0 COMMENT '客户id,对应xhGhsAdmin id字段';
+ALTER TABLE xhGhsOrder ADD `customId` INT NOT NULL DEFAULT 0 COMMENT '客户id 对应xhCustom id字段' AFTER `userId`;
+ALTER TABLE xhGhsOrder ADD customAdminId INT NOT NULL DEFAULT 0 COMMENT '客户员工id' AFTER customId;