shish 5 лет назад
Родитель
Сommit
88498373e7

+ 162 - 135
app/ghs/controllers/OrderController.php

@@ -20,139 +20,166 @@ use common\components\stringUtil;
 
 class OrderController extends BaseController
 {
-
-    public $withoutLogin = ['order-relate', 'fast-pay'];
-
-    //商城下单操作 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['payWay'] = $this->isWx == true ? 0 : 1;
-        $post['merchantId'] = $this->merchantId;
-        $post['shopId'] = 0;
-        $post['deadline'] = time() + 1800;//订单30分钟后过期
-        $post['fromType'] = 1;//商城
-        $post['prePrice'] = 0.01;
-        $post['actPrice'] = 0.01;
-        $post['sendSide'] = $post['sendSide'] ?? 0;
-
-        $productJson = $post['product'] ?? '';
-        if (empty($productJson)) {
-            util::fail('请选择花材');
-        }
-        $productList = json_decode($productJson, true);
-        if (empty($productList)) {
-            util::fail('请选择花材');
-        }
-        $productIds = array_column($productList, 'productId');
-        ProductClass::valid($productIds, $this->merchantId);
-        $post['product'] = $productList;
-        $order = OrderClass::addOrder($post);
-        $orderSn = $order['orderSn'] ?? '';
-        $orderId = $order['id'] ?? 0;
-        util::success([
-            'orderId' => $orderId,
-            'orderSn' => $orderSn,
-            'totalPrice' => 0.01,
-            'sendType' => '快递送',
-            'sendTime' => '15:00',
-            'qrCode' => Yii::$app->params['imgHost'] . '/hhb_small.png',
-        ]);
-    }
-
-    //延期支付 shish 2021.1.19
-    public function actionDebt()
-    {
-        $get = Yii::$app->request->get();
-        $orderId = $get['orderId'] ?? 0;
-        util::complete();
-    }
-
-    //获取商城下单要用的微信支付和小程序支付参数 shish 2019.21.3
-    public function actionWxPay()
-    {
-        ini_set('date.timezone', 'Asia/Shanghai');
-        $post = Yii::$app->request->post();
-        $couponId = isset($post['couponId']) ? $post['couponId'] : 0;
-        $orderSn = isset($post['orderSn']) ? $post['orderSn'] : 0;
-        $order = OrderClass::getByOrderSn($orderSn);
-        $orderId = $order['id'];
-
-        //支付前验证订单有效性
-        OrderClass::valid($order,$this->adminId);
-
-        $name = isset($order['orderName']) && !empty($order['orderName']) ? $order['orderName'] : '购买商品';
-        $totalFee = $order['actPrice'];
-
-        //小程序使用miniOpenId
-        if (httpUtil::isMiniProgram()) {
-            $openId = $this->user['miniOpenId'];
-        } else {
-            $openId = $this->user['openId'];
-        }
-        $typeList = configDict::getConfig('capitalType');
-        $capitalType = $typeList['xhOrder']['id'];
-        //流水类型、优惠卷、微信支付(h5还是小程序支付)类型 带到回调
-        $wxPayType = 0;
-        if (httpUtil::isMiniProgram()) {
-            $wxPayType = 1;
-        }
-        $attach = "couponId=" . $couponId . "&capitalType=" . $capitalType . '&wxPayType=' . $wxPayType;
-        //订单30分钟后过期
-        $now = time();
-        $expireTime = $now + 1800;
-
-        $wx = Yii::getAlias("@vendor/weixin");
-        require_once($wx . '/lib/WxPay.Api.php');
-        require_once($wx . '/example/WxPay.JsApiPay.php');
-        $input = new \WxPayUnifiedOrder();
-        $input->SetBody($name);
-        $input->SetOut_trade_no($orderSn);
-        $input->SetTotal_fee($totalFee * 100);
-        $input->SetTime_start(date("YmdHis", $now));
-        $input->SetAttach($attach);//将流水类型、代金劵等传给微信再回传
-        $input->SetTime_expire(date("YmdHis", $expireTime));
-        $input->SetNotify_url(Yii::$app->params['mallHost'] . '/notice/wx-callback/');
-        $input->SetTrade_type("JSAPI");
-
-        //花卉宝代为申请的微信支付
-        $merchantExtend = $this->merchantExtend;
-        if ($merchantExtend['wxPayApply'] == 1) {
-            $input->SetSub_openid($openId);
-        } else {
-            $input->SetOpenid($openId);
-        }
-        //小程序使用miniAppId
-        if (httpUtil::isMiniProgram()) {
-            $merchantExtend['wxAppId'] = $merchantExtend['miniAppId'];
-        }
-
-        $wxOrder = \WxPayApi::unifiedOrder($input, 6, $merchantExtend);
-        $tools = new \JsApiPay();
-        $jsApiParameters = $tools->GetJsApiParameters($wxOrder, $merchantExtend);
-        $newParams = json_decode($jsApiParameters, true);
-        //已请求微信不能修改价格
-        $updateData = [];
-        $updateData['modPrice'] = 0;
-        if (empty($order['deadline'])) {
-            $updateData['deadline'] = $expireTime;
-        }
-        OrderService::updateById($orderId, $updateData);
-        util::success($newParams);
-    }
-
+	
+	public $withoutLogin = ['order-relate', 'fast-pay'];
+	
+	//订单列表 shish 2021.1.20
+	public function actionList()
+	{
+		$get = Yii::$app->request->get();
+		$status = $get['status']?? 0;
+		if (!empty($status)) {
+			$where['status'] = $status;
+		}
+		$where['merchantId'] = $this->merchantId;
+		if (isset($get['shopId'])) {
+			$shopId = $get['shopId'] ?? 0;
+			if (!empty($shopId)) {
+				$where['shopId'] = $this->shopId;
+			}
+		} else {
+			$where['shopId'] = $this->shopId;
+		}
+		$data = OrderClass::getOrderList($where);
+		util::success($data);
+	}
+	
+	//商城下单操作 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['payWay'] = $this->isWx == true ? 0 : 1;
+		$post['merchantId'] = $this->merchantId;
+		$post['shopId'] = 0;
+		$post['deadline'] = time() + 1800;//订单30分钟后过期
+		$post['fromType'] = 1;//商城
+		$post['prePrice'] = 0.01;
+		$post['actPrice'] = 0.01;
+		$post['sendSide'] = $post['sendSide'] ?? 0;
+		
+		$productJson = $post['product'] ?? '';
+		if (empty($productJson)) {
+			util::fail('请选择花材');
+		}
+		$productList = json_decode($productJson, true);
+		if (empty($productList)) {
+			util::fail('请选择花材');
+		}
+		$productIds = array_column($productList, 'productId');
+		ProductClass::valid($productIds, $this->merchantId);
+		$post['product'] = $productList;
+		$order = OrderClass::addOrder($post);
+		$orderSn = $order['orderSn'] ?? '';
+		$orderId = $order['id'] ?? 0;
+		util::success([
+			'orderId' => $orderId,
+			'orderSn' => $orderSn,
+			'totalPrice' => 0.01,
+			'sendType' => '快递送',
+			'sendTime' => '15:00',
+			'qrCode' => Yii::$app->params['imgHost'] . '/hhb_small.png',
+		]);
+	}
+	
+	//延期支付 shish 2021.1.19
+	public function actionDebt()
+	{
+		$get = Yii::$app->request->get();
+		$orderId = $get['orderId'] ?? 0;
+		util::complete();
+	}
+	
+	//获取商城下单要用的微信支付和小程序支付参数 shish 2019.21.3
+	public function actionWxPay()
+	{
+		ini_set('date.timezone', 'Asia/Shanghai');
+		$post = Yii::$app->request->post();
+		$couponId = isset($post['couponId']) ? $post['couponId'] : 0;
+		$orderSn = isset($post['orderSn']) ? $post['orderSn'] : 0;
+		$order = OrderClass::getByOrderSn($orderSn);
+		$orderId = $order['id'];
+		
+		//支付前验证订单有效性
+		OrderClass::valid($order, $this->adminId);
+		
+		$name = isset($order['orderName']) && !empty($order['orderName']) ? $order['orderName'] : '购买商品';
+		$totalFee = $order['actPrice'];
+		
+		//小程序使用miniOpenId
+		if (httpUtil::isMiniProgram()) {
+			$openId = $this->user['miniOpenId'];
+		} else {
+			$openId = $this->user['openId'];
+		}
+		$typeList = configDict::getConfig('capitalType');
+		$capitalType = $typeList['xhOrder']['id'];
+		//流水类型、优惠卷、微信支付(h5还是小程序支付)类型 带到回调
+		$wxPayType = 0;
+		if (httpUtil::isMiniProgram()) {
+			$wxPayType = 1;
+		}
+		$attach = "couponId=" . $couponId . "&capitalType=" . $capitalType . '&wxPayType=' . $wxPayType;
+		//订单30分钟后过期
+		$now = time();
+		$expireTime = $now + 1800;
+		
+		$wx = Yii::getAlias("@vendor/weixin");
+		require_once($wx . '/lib/WxPay.Api.php');
+		require_once($wx . '/example/WxPay.JsApiPay.php');
+		$input = new \WxPayUnifiedOrder();
+		$input->SetBody($name);
+		$input->SetOut_trade_no($orderSn);
+		$input->SetTotal_fee($totalFee * 100);
+		$input->SetTime_start(date("YmdHis", $now));
+		$input->SetAttach($attach);//将流水类型、代金劵等传给微信再回传
+		$input->SetTime_expire(date("YmdHis", $expireTime));
+		$input->SetNotify_url(Yii::$app->params['mallHost'] . '/notice/wx-callback/');
+		$input->SetTrade_type("JSAPI");
+		
+		//花卉宝代为申请的微信支付
+		$merchantExtend = $this->merchantExtend;
+		if ($merchantExtend['wxPayApply'] == 1) {
+			$input->SetSub_openid($openId);
+		} else {
+			$input->SetOpenid($openId);
+		}
+		//小程序使用miniAppId
+		if (httpUtil::isMiniProgram()) {
+			$merchantExtend['wxAppId'] = $merchantExtend['miniAppId'];
+		}
+		
+		$wxOrder = \WxPayApi::unifiedOrder($input, 6, $merchantExtend);
+		$tools = new \JsApiPay();
+		$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $merchantExtend);
+		$newParams = json_decode($jsApiParameters, true);
+		//已请求微信不能修改价格
+		$updateData = [];
+		$updateData['modPrice'] = 0;
+		if (empty($order['deadline'])) {
+			$updateData['deadline'] = $expireTime;
+		}
+		OrderService::updateById($orderId, $updateData);
+		util::success($newParams);
+	}
+	
+	//已经支付
+	public function actionHasPay()
+	{
+		util::complete();
+	}
+	
 }

+ 50 - 51
biz-ghs/custom/classes/CustomClass.php

@@ -9,55 +9,54 @@ use biz\base\classes\BaseClass;
 
 class CustomClass extends BaseClass
 {
-
-    public static $baseFile = '\bizGhs\custom\models\Custom';
-
-    //组合信息 shish 2021.1.8
-    public static function groupBaseInfo($list)
-    {
-        if (empty($list)) {
-            return $list;
-        }
-        //获取零售商信息
-        $retailIdList = array_unique(array_filter(array_column($list, 'retailId')));
-        $retailInfo = MerchantClass::getByIds($retailIdList, null, 'id');
-        foreach ($list as $key => $val) {
-            $retailId = $val['retailId'];
-            $currentInfo = isset($retailInfo[$retailId]) ? $retailInfo[$retailId] : [];
-            //组合头像
-            $currentInfo = business::formatMerchantLogo($currentInfo);
-            $list[$key]['smallAvatar'] = isset($currentInfo['smallLogoUrl']) ? $currentInfo['smallLogoUrl'] : '';
-            $list[$key]['avatar'] = isset($currentInfo['logoUrl']) ? $currentInfo['logoUrl'] : '';
-            $list[$key]['visitTime'] = '06-11 12:50';
-            $list[$key]['level'] = 0;
-        }
-        return $list;
-    }
-
-    //欠款权限开关 shish 2021.1.8
-    public static function debt($custom, $debt)
-    {
-        $id = isset($custom['id']) ? $custom['id'] : 0;
-        self::updateById($id, ['debt' => $debt]);
-        return true;
-    }
-
-    //权限判断 shish 2021.1.8
-    public static function valid($custom, $merchantId)
-    {
-        if (empty($custom)) {
-            util::fail('没有找到客户');
-        }
-        if ($custom['merchantId'] != $merchantId) {
-            util::fail('您没有权限操作此客户');
-        }
-    }
-
-    //创建客户 shish 2021.1.18
-    public static function addCustom()
-    {
-
-    }
-
-
+	
+	public static $baseFile = '\bizGhs\custom\models\Custom';
+	
+	public static function getCustomByIds($ids)
+	{
+		$list = self::getByIds($ids, null, 'id');
+		return self::groupBaseInfo($list);
+	}
+	
+	//整合头像等信息 shish 2021.1.8
+	public static function groupBaseInfo($list)
+	{
+		if (empty($list)) {
+			return $list;
+		}
+		//获取客户信息
+		$downIdList = array_unique(array_filter(array_column($list, 'downId')));
+		$retailInfo = MerchantClass::getByIds($downIdList, null, 'id');
+		foreach ($list as $key => $val) {
+			$downId = $val['downId'];
+			$currentInfo = isset($retailInfo[$downId]) ? $retailInfo[$downId] : [];
+			//组合头像
+			$currentInfo = business::formatMerchantLogo($currentInfo);
+			$list[$key]['smallAvatar'] = isset($currentInfo['smallLogoUrl']) ? $currentInfo['smallLogoUrl'] : '';
+			$list[$key]['avatar'] = isset($currentInfo['logoUrl']) ? $currentInfo['logoUrl'] : '';
+			$list[$key]['visitTime'] = '06-11 12:50';
+			$list[$key]['level'] = 0;
+		}
+		return $list;
+	}
+	
+	//欠款权限开关 shish 2021.1.8
+	public static function debt($custom, $debt)
+	{
+		$id = isset($custom['id']) ? $custom['id'] : 0;
+		self::updateById($id, ['debt' => $debt]);
+		return true;
+	}
+	
+	//权限判断 shish 2021.1.8
+	public static function valid($custom, $merchantId)
+	{
+		if (empty($custom)) {
+			util::fail('没有找到客户');
+		}
+		if ($custom['merchantId'] != $merchantId) {
+			util::fail('您没有权限操作此客户');
+		}
+	}
+	
 }

+ 9 - 9
biz-ghs/custom/services/CustomService.php

@@ -34,15 +34,15 @@ class CustomService extends BaseService
 		}
 		$list = CustomClass::groupBaseInfo([$custom]);
 		$custom = current($list);
-		$retailShopId = $custom['retailShopId'] ?? 0;
-		$retailShop = \biz\merchant\classes\ShopClass::getById($retailShopId);
-		$super = \biz\merchant\classes\ShopClass::getSuper($retailShopId);
-		$custom['province'] = $retailShop['province'] ?? '';
-		$custom['city'] = $retailShop['city'] ?? '';
-		$custom['address'] = $retailShop['address'] ?? '';
-		$custom['floor'] = $retailShop['floor'] ?? '';
-		$custom['lat'] = $retailShop['lat'] ?? '';
-		$custom['long'] = $retailShop['long'] ?? '';
+		$downShopId = $custom['downShopId'] ?? 0;
+		$downShop = \biz\merchant\classes\ShopClass::getById($downShopId);
+		$super = \biz\merchant\classes\ShopClass::getSuper($downShopId);
+		$custom['province'] = $downShop['province'] ?? '';
+		$custom['city'] = $downShop['city'] ?? '';
+		$custom['address'] = $downShop['address'] ?? '';
+		$custom['floor'] = $downShop['floor'] ?? '';
+		$custom['lat'] = $downShop['lat'] ?? '';
+		$custom['long'] = $downShop['long'] ?? '';
 		$custom['userName'] = $super['adminName'] ?? '';
 		$custom['mobile'] = $super['mobile'] ?? '';
 		return $custom;

+ 92 - 65
biz-ghs/order/classes/OrderClass.php

@@ -3,6 +3,8 @@
 namespace bizGhs\order\classes;
 
 use biz\merchant\classes\MerchantAssetClass;
+use bizGhs\admin\classes\AdminClass;
+use bizGhs\custom\classes\CustomClass;
 use bizGhs\stat\classes\StatOrderCountClass;
 use common\components\orderSn;
 use common\components\stringUtil;
@@ -11,72 +13,97 @@ use bizGhs\base\classes\BaseClass;
 
 class OrderClass extends BaseClass
 {
+	
+	public static $baseFile = '\bizGhs\order\models\Order';
+	
+	//已完成
+	const ORDER_STATUS_COMPLETE = 6;
+	//已取消
+	const ORDER_STATUS_CANCEL = 5;
+	//待通知
+	const ORDER_STATUS_UN_NOTICE = 4;
+	//配送中
+	const ORDER_STATUS_SENDING = 3;
+	//待配送
+	const ORDER_STATUS_UN_SEND = 2;
+	//待付款,待确认
+	const ORDER_STATUS_UN_PAY = 1;
+	
+	//未确认配送方式
+	const SEND_TYPE_UNKNOWN = 1;
+	//自取,免配送
+	const SEND_TYPE_NO = 2;
+	//自己送
+	const SEND_TYPE_MYSELF = 3;
+	//快递送,别人送
+	const SEND_TYPE_OTHER = 4;
+	
+	//添加订单 shish 2019.12.5
+	public static function addOrder($data)
+	{
+		$date = date("Y-m-d H:i:s");
+		$merchantId = $data['merchantId'] ?? 0;
+		$month = date("Ym");
+		$data['orderSn'] = orderSn::getGhsOrderSn();
+		$data['payStatus'] = 0;
+		$data['createTime'] = $date;
+		$data['addTime'] = time();
+		
+		//花材列表
+		$product = $data['product'];
+		OrderItemClass::batchAdd($product);
+		
+		//将花店每月的总订单数作为编号
+		$riseNum = StatOrderCountClass::addOrder($month, $merchantId);
+		$data['sendNum'] = $riseNum;
+		$data['num'] = 1;
+		$data['smallNum'] = 1;
+		$return = self::add($data);
+		
+		//全部订单+1,待付款订单+1
+		$merchantAsset = MerchantAssetClass::getByMerchantId($merchantId, true);
+		$merchantAsset->unPayOrder += 1;
+		$merchantAsset->totalOrder += 1;
+		$merchantAsset->save();
+		
+		return $return;
+	}
+	
+	//根据订单编号查询 shish 2021.19
+	public static function getByOrderSn($orderSn)
+	{
+		return self::getByCondition(['orderSn' => $orderSn]);
+	}
+	
+	//订单列表 shish 2021.1.19
+	public static function getOrderList($where)
+	{
+		$data = self::getList('*', $where, 'addTime DESC');
+		$data['list'] = self::groupOrder($data['list']);
+		return $data;
+	}
+	
+	//整订单员工、供货商信息 shish 2021.1.19
+	public static function groupOrder($list)
+	{
+		if (empty($list)) {
+			return $list;
+		}
 
-    public static $baseFile = '\bizGhs\order\models\Order';
+		$customIds = array_unique(array_filter(array_column($list, 'customId')));
+		$customInfo = CustomClass::getCustomByIds($customIds);
+dd($customInfo);
+		$adminIds = array_unique(array_filter(array_column($list, 'adminId')));
+		$adminInfo = AdminClass::getAdminByIds($adminIds, null, 'id');
 
-
-    //已退款
-    const ORDER_STATUS_REFUND = 6;
-    //完成
-    const ORDER_STATUS_COMPLETE = 5;
-    //已取消
-    const ORDER_STATUS_CANCEL = 4;
-    //待通知
-    const ORDER_STATUS_UN_NOTICE = 3;
-    //配送中
-    const ORDER_STATUS_SENDING = 2;
-    //待配送
-    const ORDER_STATUS_UN_SEND = 1;
-    //待付款
-    const ORDER_STATUS_UN_PAY = 0;
-    //订单总流程数
-    const ORDER_TOTAL_FLOW = 4;
-
-    //未确认配送方式
-    const SEND_TYPE_UNKNOWN = 0;
-    //自取
-    const SEND_TYPE_NO = 1;
-    //自己送
-    const SEND_TYPE_MYSELF = 2;
-    //代送
-    const SEND_TYPE_OTHER = 3;
-
-
-    //添加订单 shish 2019.12.5
-    public static function addOrder($data)
-    {
-        $date = date("Y-m-d H:i:s");
-        $merchantId = $data['merchantId'] ?? 0;
-        $month = date("Ym");
-        $data['orderSn'] = orderSn::getGhsOrderSn();
-        $data['payStatus'] = 0;
-        $data['createTime'] = $date;
-        $data['addTime'] = time();
-
-        //花材列表
-        $product = $data['product'];
-        OrderItemClass::batchAdd($product);
-
-        //将花店每月的总订单数作为编号
-        $riseNum = StatOrderCountClass::addOrder($month, $merchantId);
-        $data['sendNum'] = $riseNum;
-        $data['num'] = 1;
-        $data['smallNum'] = 1;
-        $return = self::add($data);
-
-        //全部订单+1,待付款订单+1
-        $merchantAsset = MerchantAssetClass::getByMerchantId($merchantId, true);
-        $merchantAsset->unPayOrder += 1;
-        $merchantAsset->totalOrder += 1;
-        $merchantAsset->save();
-
-        return $return;
-    }
-
-    //根据订单编号查询 shish 2021.19
-    public static function getByOrderSn($orderSn)
-    {
-        return self::getByCondition(['orderSn' => $orderSn]);
-    }
+		foreach ($list as $key => $val) {
+			$adminId = $val['adminId'] ?? 0;
+			$list[$key]['adminName'] = $adminInfo[$adminId]['adminName'] ?? '';
+			$customId = $val['customId'] ?? 0;
+			$list[$key]['customName'] = $customInfo[$customId]['shopName'] ?? '';
+			$list[$key]['customAvatar'] = '';
+		}
+		return $list;
+	}
 
 }

+ 2 - 2
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -142,10 +142,10 @@ class PurchaseOrderClass extends BaseClass
     	if(empty($list)){
 		    return $list;
 	    }
-	    $supplierIds = array_column($list,'supplierId');
+	    $supplierIds = array_unique(array_filter(array_column($list,'supplierId')));
     	$supplierInfo = SupplierClass::getByIds($supplierIds,null,'id');
 
-    	$adminIds = array_column($list,'adminId');
+    	$adminIds = array_unique(array_filter(array_column($list,'adminId')));
 	    $adminInfo = AdminClass::getAdminByIds($adminIds,null,'id');
 
 	    foreach($list as $k => $val){

+ 10 - 0
sql.sql

@@ -730,3 +730,13 @@ ALTER TABLE `xhGhsOrder` ADD smallNum SMALLINT NOT NULL DEFAULT 0 COMMENT '小
 ALTER TABLE `xhGhsPurchaseOrder`
 CHANGE COLUMN `bigNum` `num`  int(11) NOT NULL DEFAULT 0 COMMENT '合计多少商品(大单位 -扎)' AFTER `supplierId`,
 CHANGE COLUMN `totalPrice` `price`  decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '商品总价格' AFTER `smallNum`;
+
+=====
+== shish 2021-01-20
+ALTER TABLE `xhGhsOrder` MODIFY `status` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '订单状态 1待付款 2待配送 3配送中 4待通知 5已取消 6已完成';
+ALTER TABLE xhGhsOrder MODIFY `sendType` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '1未确认 2免配送,自取 3自己送 4别人送,快递送';
+ALTER TABLE `xhGhsOrder` DROP COLUMN `userId`;
+ALTER TABLE xhGhsOrder CHANGE `ghsId` `merchantId` INT NOT NULL DEFAULT 0 COMMENT '商家id';
+ALTER TABLE `xhGhsCustom` CHANGE `retailId` `downId` INT(11) NOT NULL DEFAULT '0' COMMENT '客户商id,下游商家id';
+ALTER TABLE `xhGhsCustom` CHANGE `retailShopId` `downShopId` INT(11) NOT NULL DEFAULT '0' COMMENT '客户门店id,下游门店id';
+ALTER TABLE `xhGhsCustom` CHANGE `shopName` `name` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '客户名称,纯彩花艺 集美店';