shish 4 лет назад
Родитель
Сommit
c6c984ea5f

+ 86 - 84
app-ghs/controllers/CategoryController.php

@@ -15,90 +15,92 @@ use common\components\util;
 
 class CategoryController extends BaseController
 {
-	
-	//分类列表
-	public function actionList()
-	{
-		$list = CategoryService::getCategoryList($this->sjId);
-		util::success($list);
-	}
-	
-	//查看详情 ssh 2019.12.8
-	public function actionDetail()
-	{
-		$id = Yii::$app->request->get('categoryId', 0);
-		$category = CategoryService::getById($id);
-		CategoryService::valid($category, $this->sjId);
-		$info = CategoryService::getInfo($id);
-		util::success($info);
-	}
-	
-	//添加分类 ssh 2019.12.8
-	public function actionAdd()
-	{
-		$post = Yii::$app->request->post();
-		$post['sjId'] = $this->sjId;
-		$cat = CategoryService::addCategory($post);
-		util::success(['id' => $cat['id']]);
-	}
-	
-	//更新分类 ssh 2019.12.8
-	public function actionUpdate()
-	{
-		$post = Yii::$app->request->post();
-		$categoryId = isset($post['categoryId']) ? $post['categoryId'] : 0;
-		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->sjId);
-		CategoryService::updateCategory($category, $post);
-		util::complete('修改成功');
-	}
-	
-	//分类启用停用 ssh 2019.12.8
-	public function actionChangeStatus()
-	{
-		$get = Yii::$app->request->get();
-		$categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
-		$status = isset($get['status']) ? $get['status'] : 0;
-		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->sjId);
-		CategoryService::changeStatus($categoryId, $status);
-		util::complete();
-	}
-	
-	//删除分类 ssh 2019.12.28
-	public function actionDelete()
-	{
-		$get = Yii::$app->request->get();
-		$categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
-		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->sjId);
-		CategoryService::deleteCategory($categoryId);
-		util::complete('删除成功');
-	}
-	
-	//取分类下商品 ssh 2019.12.2
-	public function actionGoodsList()
-	{
-		$categoryId = Yii::$app->request->get('categoryId');
-		//没有分类默认取商家第一个分类
-		$categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->sjId);
-		$where = [];
-		$where['sjId'] = $this->sjId;
-		$where['cId'] = $categoryId;
-		$where['delStatus'] = 0;
-		$data = GoodsCategoryService::getGoodsList($where);
-		util::success($data);
-	}
 
-	//分类排序 ssh 2020.3.11
-	public function actionSort()
-	{
-		$id = Yii::$app->request->get('id', 0);
-		$inTurn = Yii::$app->request->get('inTurn', 0);
-		$category = CategoryService::getById($id);
-		CategoryService::valid($category, $this->sjId);
-		CategoryService::updateById($id, ['inTurn' => $inTurn]);
-		util::complete();
-	}
+    //分类列表
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $property = $get['property'] ?? '';
+        $list = CategoryService::getCategoryList($this->sjId, $property);
+        util::success($list);
+    }
+
+    //查看详情 ssh 2019.12.8
+    public function actionDetail()
+    {
+        $id = Yii::$app->request->get('categoryId', 0);
+        $category = CategoryService::getById($id);
+        CategoryService::valid($category, $this->sjId);
+        $info = CategoryService::getInfo($id);
+        util::success($info);
+    }
+
+    //添加分类 ssh 2019.12.8
+    public function actionAdd()
+    {
+        $post = Yii::$app->request->post();
+        $post['sjId'] = $this->sjId;
+        $cat = CategoryService::addCategory($post);
+        util::success(['id' => $cat['id']]);
+    }
+
+    //更新分类 ssh 2019.12.8
+    public function actionUpdate()
+    {
+        $post = Yii::$app->request->post();
+        $categoryId = isset($post['categoryId']) ? $post['categoryId'] : 0;
+        $category = CategoryService::getById($categoryId);
+        CategoryService::valid($category, $this->sjId);
+        CategoryService::updateCategory($category, $post);
+        util::complete('修改成功');
+    }
+
+    //分类启用停用 ssh 2019.12.8
+    public function actionChangeStatus()
+    {
+        $get = Yii::$app->request->get();
+        $categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
+        $status = isset($get['status']) ? $get['status'] : 0;
+        $category = CategoryService::getById($categoryId);
+        CategoryService::valid($category, $this->sjId);
+        CategoryService::changeStatus($categoryId, $status);
+        util::complete();
+    }
+
+    //删除分类 ssh 2019.12.28
+    public function actionDelete()
+    {
+        $get = Yii::$app->request->get();
+        $categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
+        $category = CategoryService::getById($categoryId);
+        CategoryService::valid($category, $this->sjId);
+        CategoryService::deleteCategory($categoryId);
+        util::complete('删除成功');
+    }
+
+    //取分类下商品 ssh 2019.12.2
+    public function actionGoodsList()
+    {
+        $categoryId = Yii::$app->request->get('categoryId');
+        //没有分类默认取商家第一个分类
+        $categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->sjId);
+        $where = [];
+        $where['sjId'] = $this->sjId;
+        $where['cId'] = $categoryId;
+        $where['delStatus'] = 0;
+        $data = GoodsCategoryService::getGoodsList($where);
+        util::success($data);
+    }
+
+    //分类排序 ssh 2020.3.11
+    public function actionSort()
+    {
+        $id = Yii::$app->request->get('id', 0);
+        $inTurn = Yii::$app->request->get('inTurn', 0);
+        $category = CategoryService::getById($id);
+        CategoryService::valid($category, $this->sjId);
+        CategoryService::updateById($id, ['inTurn' => $inTurn]);
+        util::complete();
+    }
 
 }

+ 3 - 2
app-hd/controllers/CategoryController.php

@@ -13,8 +13,9 @@ class CategoryController extends BaseController
     //分类列表
     public function actionList()
     {
-
-        $list = CategoryService::getCategoryList($this->sjId);
+        $get = Yii::$app->request->get();
+        $property = $get['property'] ?? '';
+        $list = CategoryService::getCategoryList($this->sjId, $property);
         util::success($list);
     }
 

+ 2 - 4
app-hd/controllers/GoodsController.php

@@ -38,11 +38,9 @@ class GoodsController extends BaseController
         if (!empty($cId)) {
             $where['cId'] = $cId;
         }
-        $where['sjId'] = $this->sjId;
+        $where['mainId'] = $this->mainId;
         $where['delStatus'] = 0;
         $data = GoodsService::getGoodsList($where);
-        $asset = MerchantAssetService::getBySjId($this->sjId);
-        $data['MerchantAsset'] = $asset;
         util::success($data);
     }
 
@@ -215,7 +213,7 @@ class GoodsController extends BaseController
         }
         $order = OrderService::getOrderBySn($orderSn);
         OrderService::valid($order, $this->shopId);
-        $save = GoodsService::saveItemGroup($order, $itemInfo,  $classId, $goodsName,$this->adminId);
+        $save = GoodsService::saveItemGroup($order, $itemInfo, $classId, $goodsName, $this->adminId);
         if ($save) {
             util::complete();
         }

+ 4 - 2
app-hd/controllers/GroupController.php

@@ -2,6 +2,7 @@
 
 namespace hd\controllers;
 
+use bizHd\group\classes\GroupClass;
 use bizHd\group\services\GroupService;
 use common\components\util;
 use Yii;
@@ -14,8 +15,9 @@ class GroupController extends BaseController
     //组合列表 shish 20220315
     public function actionList()
     {
-        $where = ['shopId' => $this->shopId];
-        $list = GroupService::getGroupList($where);
+        $date = date("Y-m-d 00:00:00");
+        $where = ['shopId' => $this->shopId, 'addTime>' => $date];
+        $list = GroupClass::getGroupList($where);
         util::success($list);
     }
 

+ 7 - 170
app-hd/controllers/OrderController.php

@@ -36,184 +36,21 @@ class OrderController extends BaseController
     public function actionCreateOrder()
     {
         $post = Yii::$app->request->post();
-        $needSend = isset($post['needSend']) && is_numeric($post['needSend']) ? $post['needSend'] : 1;
-        $orderType = $post['orderType'] ?? 1;
         $post['sjId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
         $post['payWay'] = $this->isWx == true ? 0 : 1;
         $now = time();
-        $expireTime = $now + 1800;//订单30分钟后过期
+        //订单30分钟后过期
+        $expireTime = $now + 1800;
         $post['deadline'] = $expireTime;
-        $post['fromType'] = 1;//商城
-        $customId = $post['customId'] ?? 0;
-        if (!empty($customId)) {
-            $customInfo = CustomClass::getCustomInfo($customId);
-            CustomClass::valid($customInfo, $this->shopId);
-            $post['customId'] = $customId;
-        }
-        //门店订单
-        $post['store'] = 1;
-        //员工信息
-        $shopAdmin = $this->shopAdmin->attributes;
-        $shopAdminName = $shopAdmin['name'] ?? '';
-        $post['shopAdminName'] = $shopAdminName;
-        $post['shopAdminId'] = $this->shopAdminId;
-
-        $couponId = isset($post['couponId']) && !empty($post['couponId']) ? $post['couponId'] : 0;
-
-        if ($orderType == 1) {
-            //$orderType = 1 成品订单
-            $goodsInfo = $post['goodsInfo'] ?? '';
-            $goodsInfoArr = json_decode($goodsInfo, true);
-            if (empty($goodsInfoArr)) {
-                util::fail('请选择商品');
-            }
-            //总的商品金额
-            $totalGoodsPrice = 0;
-            $orderGoods = [];
-            foreach ($goodsInfoArr as $key => $currentGoods) {
-                $currentGoodsId = $currentGoods['goodsId'];
-                $currentGoodsInfo = GoodsService::getGoodsInfo($currentGoodsId);
-                if (empty($currentGoodsInfo)) {
-                    util::fail('没有找到商品');
-                }
-                $goodsStyleId = $currentGoods['goodsStyleId'];
-                $goodsNum = $currentGoods['goodsNum'];
-                //计算总金额
-                $unitPrice = $currentGoodsInfo['price'];
-                $goodsStyleList = isset($currentGoodsInfo['goodsStyleList']) ? $currentGoodsInfo['goodsStyleList'] : [];
-                if (!empty($goodsStyleId)) {
-                    $idKeyStyleList = array_column($goodsStyleList, null, 'id');
-                    if (empty($goodsStyleList)) {
-                        util::fail('商品款式没有找到');
-                    }
-                    $styleIdList = array_keys(array_column($goodsStyleList, null, "id"));
-                    if (in_array($goodsStyleId, $styleIdList) == false) {
-                        util::fail('商品款式没有找到!');
-                    }
-                    if (isset($idKeyStyleList[$goodsStyleId]['price']) == false) {
-                        util::fail('没有找到多款式的价格');
-                    }
-                    $unitPrice = $idKeyStyleList[$goodsStyleId]['price'];
-                }
-                $goodsPrice = $unitPrice * $goodsNum;
-                $totalGoodsPrice = stringUtil::calcAdd($totalGoodsPrice, $goodsPrice);
-                $orderGoods[] = [
-                    'goodsId' => $currentGoodsId,
-                    'userId' => $this->adminId,
-                    'sjId' => $this->sjId,
-                    'title' => $currentGoodsInfo['goodsName'],
-                    'cover' => isset($goodsInfo['shortImgList']) && !empty($currentGoodsInfo['shortImgList']) ? current($currentGoodsInfo['shortImgList']) : '',
-                    'unitPrice' => $unitPrice,
-                    'num' => $goodsNum,
-                    'goodsStyleName' => isset($currentGoodsInfo['goodsStyleList'][$goodsStyleId]['title']) ? $currentGoodsInfo['goodsStyleList'][$goodsStyleId]['title'] : '',
-                    'goodsStyleId' => $goodsStyleId,
-                    'createTime' => date("Y-m-d H:i:s"),
-                ];
+        //商城
+        $post['fromType'] = 1;
 
-            }
-            $user = $this->custom;
-            $post['bookName'] = isset($user['name']) ? $user['name'] : '';
-            $bookMobile = isset($post['bookMobile']) && !empty($post['bookMobile']) && stringUtil::isMobile($post['bookMobile']) ? $post['bookMobile'] : '';
-            $bookMobile = empty($bookMobile) && isset($user['mobile']) && !empty($user['mobile']) ? $user['mobile'] : $bookMobile;
-            $post['bookMobile'] = $bookMobile;
-
-            //计算运费
-            $post['sendDistance'] = isset($post['sendDistance']) ? $post['sendDistance'] : 0;
-            $sendCost = isset($post['sendCost']) && is_numeric($post['sendCost']) ? $post['sendCost'] : 0;
-            //按距离计算运费并且客户要求送的
-            //运费计算方式
-            //$freightType = 0;
-            //if ($freightType == 0 && $needSend == 1) {
-            //$lat = $post['latitude']??'';//收货人纬度
-            //$lng = $post['longitude']??'';//收货人经度
-            //$respond = ExpressService::getUserDistance($lng, $lat, $defaultShopId, $this->sjExtend);
-            //$sendCost = isset($respond['fee']) ? $respond['fee'] : 0;
-            //}
-            $post['sendCost'] = $sendCost;
-            $currentPrice = stringUtil::calcAdd($sendCost, $totalGoodsPrice);
-            $post['prePrice'] = $currentPrice;
-            if (isset($post['modifyPrice'])) {
-                //商家打折,修改金额
-                $modifyPrice = $post['modifyPrice'] ?? 0;
-                if ($modifyPrice > $currentPrice) {
-                    util::fail('实收金额大于订单总金额');
-                }
-                if ($modifyPrice < $currentPrice) {
-                    $post['discountAmount'] = bcsub($currentPrice, $modifyPrice, 2);
-                    $post['discountType'] = dict::getDict('discountType', 'discount');
-                    $currentPrice = $modifyPrice;
-                }
-            }
-            $post['actPrice'] = $currentPrice;
-            $post['realPrice'] = $currentPrice;
-            $order = OrderClass::addOrder($post);
-            $orderId = $order['id'];
-            $orderSn = $order['orderSn'];
+//        $payWay = $post['payWay'] ?? dict::getDict('payWay', 'wxPay');
+//        OrderClass::staffKdPay($payWay, $orderSn);
 
-            foreach ($orderGoods as $key => $val) {
-                $val['orderId'] = $orderId;
-                $val['orderSn'] = $orderSn;
-                OrderGoodsService::add($val);//创建订单商品列表
-            }
-        } else {
-            //$orderType = 2 花材订单 组合开单
-            $productData = $post['product'] ?? '';
-            $product = json_decode($productData, true);
-            if (empty($product)) {
-                util::fail('请选择花材');
-            }
-            $currentPrice = $post['packingFee'] ?? 0; //包装费
-            $orderProduct = [];
-            $level = 1;
-            $productInfo = ProductClass::formatProductInfo($product, $level);
-            $currentPrice = bcadd($currentPrice, $productInfo['price'], 2);
-            $sendCost = isset($post['sendCost']) && is_numeric($post['sendCost']) ? $post['sendCost'] : 0;
-            $post['sendCost'] = $sendCost;
-            $currentPrice = bcadd($currentPrice, $sendCost, 2);
-            $post['prePrice'] = $currentPrice;
-
-            if (isset($post['modifyPrice'])) {
-                //商家打折,修改金额
-                $modifyPrice = $post['modifyPrice'] ?? 0;
-                if ($modifyPrice > $currentPrice) {
-                    util::fail('实收金额大于订单总金额');
-                }
-                if ($modifyPrice < $currentPrice) {
-                    $post['discountAmount'] = bcsub($currentPrice, $modifyPrice, 2);
-                    $post['discountType'] = dict::getDict('discountType', 'discount');
-                    $currentPrice = $modifyPrice;
-                }
-            }
-            $post['actPrice'] = $currentPrice;
-            $post['realPrice'] = $currentPrice;
-
-            foreach ($product as $key => $val) {
-                $productId = $val['productId'];
-                $bigNum = $val['bigNum'];
-                $smallNum = $val['smallNum'];
-                $orderProduct[] = [
-                    'productId' => $productId,
-                    'bigNum' => $bigNum,
-                    'smallNum' => $smallNum,
-                ];
-                //减库存
-                ProductClass::decreaseStock($productId, $bigNum, $smallNum, true);
-            }
-
-            $order = OrderClass::addOrder($post);
-            $orderId = $order['id'];
-            $orderSn = $order['orderSn'];
-
-            foreach ($orderProduct as $key => $val) {
-                $val['orderSn'] = $orderSn;
-                OrderItemClass::add($val);
-            }
-        }
-        $payWay = $post['payWay'] ?? dict::getDict('payWay', 'wxPay');
-        OrderClass::staffKdPay($payWay, $orderSn);
+//        util::success(['orderSn' => $orderSn, 'totalPrice' => $currentPrice, 'couponId' => $couponId, 'orderId' => $orderId]);
 
-        util::success(['orderSn' => $orderSn, 'totalPrice' => $currentPrice, 'couponId' => $couponId, 'orderId' => $orderId]);
     }
 
     //下单要用到的相关信息 ssh 2019.12.6

+ 2 - 0
biz-hd/goods/classes/GoodsClass.php

@@ -6,6 +6,7 @@ use biz\goods\models\Goods;
 use bizHd\goods\services\GoodsCategoryService;
 use biz\sj\services\MerchantService;
 use common\components\business;
+use common\components\imgUtil;
 use common\components\stringUtil;
 use common\components\util;
 use Yii;
@@ -75,6 +76,7 @@ class GoodsClass extends BaseClass
             if ($val['stock'] == Goods::FULL_STOCK) {
                 $val['stock'] = '';
             }
+            $val['cover'] = isset($val['smallImgList'][0]) ? $val['smallImgList'][0] : imgUtil::groupImg('');
             $list[$key] = $val;
         }
         return $list;

+ 7 - 3
biz-hd/goods/services/CategoryService.php

@@ -17,11 +17,15 @@ class CategoryService extends BaseService
     public static $baseFile = '\bizHd\goods\classes\CategoryClass';
 
     //取所有的分类 ssh 2019.12.7
-    public static function getCategoryList($sjId)
+    public static function getCategoryList($sjId, $property = '')
     {
-        $cat = CategoryClass::getAllByCondition(['sjId' => $sjId, 'delStatus' => 0], 'inTurn DESC', '*');
+        $where = ['sjId' => $sjId, 'delStatus' => 0];
+        if (is_numeric($property)) {
+            $where['property'] = $property;
+        }
+        $cat = CategoryClass::getAllByCondition($where, 'inTurn DESC', '*');
         if (empty($cat)) {
-            return [];
+            return $cat;
         }
         foreach ($cat as $key => $info) {
             $img = $info['img'] ?? '';

+ 12 - 0
biz-hd/group/classes/GroupClass.php

@@ -11,6 +11,18 @@ class GroupClass extends BaseClass
 
     public static $baseFile = '\bizHd\group\models\Group';
 
+    public static function getGroupList($where)
+    {
+        $order = 'num DESC,addTime DESC';
+        $data = GroupClass::getList('*', $where, $order);
+        $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
+        if (empty($list)) {
+            return $data;
+        }
+        $data['list'] = self::groupBaseInfo($list);
+        return $data;
+    }
+
     public static function groupBaseInfo($list)
     {
         if (empty($list)) {

+ 0 - 12
biz-hd/group/services/GroupService.php

@@ -10,16 +10,4 @@ class GroupService extends BaseService
 
     public static $baseFile = '\bizHd\group\classes\GroupClass';
 
-    public static function getGroupList($where)
-    {
-        $order = 'num DESC,addTime DESC';
-        $data = GroupClass::getList('*', $where, $order);
-        $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
-        if (empty($list)) {
-            return $data;
-        }
-        $data['list'] = GroupClass::groupBaseInfo($list);
-        return $data;
-    }
-
 }

+ 37 - 0
console/controllers/InitController.php

@@ -10,6 +10,10 @@ use biz\shop\classes\ShopCapitalClass;
 use biz\shop\classes\ShopClass;
 use biz\shop\classes\ShopYeChangeClass;
 use biz\sj\classes\CashClass;
+use biz\stat\classes\StatCgClass;
+use biz\stat\classes\StatCgGhsClass;
+use biz\stat\classes\StatCgGhsMonthClass;
+use biz\stat\classes\StatCgMonthClass;
 use biz\stat\classes\StatOrderCountClass;
 use biz\stat\classes\StatOutClass;
 use biz\stat\classes\StatOutMonthClass;
@@ -17,6 +21,8 @@ use biz\stat\classes\StatSaleClass;
 use biz\stat\classes\StatSaleMonthClass;
 use bizGhs\stat\classes\StatYjClass;
 use bizGhs\stat\classes\StatYjMonthClass;
+use bizHd\goods\classes\GoodsCategoryClass;
+use bizHd\goods\classes\GoodsClass;
 use bizHd\stat\classes\StatOrderClass;
 use bizHd\stat\classes\StatOrderMonthClass;
 use bizHd\stat\classes\StatUserClass;
@@ -33,6 +39,8 @@ class InitController extends Controller
     // shish 20220313
     public function actionGhsCenter()
     {
+
+        //批发
         $shopList = ShopClass::getAllByCondition(['ptStyle' => 2], null, '*', null, true);
         if (empty($shopList)) {
             return false;
@@ -83,6 +91,35 @@ class InitController extends Controller
 
             StatOrderCountClass::updateByCondition(['shopId' => $shopId], ['mainId' => $mainId]);
 
+            //采购统计的中央化
+            StatCgClass::updateByCondition(['shopId' => $shopId], ['mainId' => $mainId]);
+            StatCgMonthClass::updateByCondition(['shopId' => $shopId], ['mainId' => $mainId]);
+            StatCgGhsClass::updateByCondition(['shopId' => $shopId], ['mainId' => $mainId]);
+            StatCgGhsMonthClass::updateByCondition(['shopId' => $shopId], ['mainId' => $mainId]);
+
+        }
+
+        //零售
+        $shopList = ShopClass::getAllByCondition(['ptStyle' => 1], null, '*', null, true);
+        if (empty($shopList)) {
+            return false;
+        }
+        foreach ($shopList as $shop) {
+            $mainId = $shop->mainId ?? 0;
+            if (empty($mainId)) {
+                $main = MainClass::add(['id' => null], true);
+                $mainId = $main->id ?? 0;
+                if (empty($mainId)) {
+                    echo "mainId没有生成 \n";
+                    exit();
+                }
+                $shop->mainId = $mainId;
+                $shop->save();
+            }
+
+            $sjId = $shop->sjId ?? 0;
+            GoodsClass::updateByCondition(['sjId' => $sjId], ['mainId' => $mainId]);
+            GoodsCategoryClass::updateByCondition(['sjId' => $sjId], ['mainId' => $mainId]);
         }
 
     }

+ 17 - 0
sql.txt

@@ -287,6 +287,23 @@ CREATE TABLE IF NOT EXISTS `xhGroupGoods`(
 `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'
 )COMMENT='组合商品';
 
+
+ALTER TABLE `xhGroup` ADD INDEX idx_shopId (`shopId`,`addTime`);
+ALTER TABLE xhGoods ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `id`;
+ALTER TABLE xhGoodsCategory ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `id`;
+ALTER TABLE xhGoods ADD cover VARCHAR(800) NOT NULL DEFAULT '' COMMENT '封面' AFTER `goodsName`;
+
+ALTER TABLE xhGoods MODIFY `property` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '属性 0鲜花成品 1盆栽绿植花瓶 2花材';
+ALTER TABLE xhGhsItem ADD `property` TINYINT(4) NOT NULL DEFAULT '2' COMMENT '属性 0鲜花成品 1盆栽绿植花瓶 2花材' AFTER `cover`;
+ALTER TABLE xhGoods MODIFY `property` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '属性 0成品 1花材,前端开发区分使用';
+ALTER TABLE xhGhsItem MODIFY `property` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '属性 0成品 1花材,前端开发区分使用';
+ALTER TABLE xhGoods ADD flower TINYINT NOT NULL DEFAULT 0 COMMENT '0非鲜花成品,绿植盆栽花瓶 1鲜花成品' AFTER `property`;
+
+ALTER TABLE xhStatCg ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
+ALTER TABLE xhStatCgGhs ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
+ALTER TABLE xhStatCgGhsMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
+ALTER TABLE xhStatCgMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
+
 ============ 批发零售绑定关系 shish 20220314