Преглед изворни кода

Merge branch 'master' of http://git.huaml.com/zhh/huahuibao

shish пре 10 месеци
родитељ
комит
7473171f76

+ 63 - 4
app-hd/controllers/ItemController.php

@@ -2,11 +2,9 @@
 
 namespace hd\controllers;
 
-
 use biz\item\classes\PtItemClass;
-
-use bizGhs\item\classes\ItemClass;
-use bizGhs\item\services\ItemService;
+use bizHd\item\classes\ItemClass;
+use bizGhs\pictext\classes\PicTextGhsItemClass;
 use bizHd\custom\classes\CustomClass;
 use bizHd\product\classes\ProductClass;
 use bizHd\wx\classes\WxOpenClass;
@@ -348,4 +346,65 @@ class ItemController extends BaseController
         util::success($respond);
     }
 
+    //获取花材描述
+    public function actionDesc()
+    {
+        $itemId = Yii::$app->request->get('itemId', 0);
+        $picText = PicTextGhsItemClass::getByCondition(['mainId'=> $this->mainId, 'ghsItemId' => $itemId, 'delStatus' => 0], true);
+        if (empty($picText)) {
+            // 适配前端的返回处理 -- 本来要使用 util::fail()
+            util::success('not_exist');
+        }
+        if ($picText->mainId != $this->mainId) {
+            util::fail('没有找到描述');
+        }
+        util::success($picText);
+    }
+
+    //创建花材描述(花材介绍)
+    public function actionCreateDesc()
+    {
+        $form = new \ghs\models\item\CreateDescForm(); // 暂时使用同一份 ghs,项目独立时,再复制一份
+        $form->load(Yii::$app->request->post(), '');
+        if (!$form->validateForm()) {
+            return;
+        }
+
+        $data = $form->attributes;
+        $exists = PicTextGhsItemClass::exists(['mainId'=>$this->mainId, 'ghsItemId' => $data['itemId'], 'delStatus' => 0]);
+        if ($exists) {
+            util::fail('该商品已存在图文内容,请勿重复添加');
+        }
+
+        $data['mainId'] = $this->mainId;
+        $data['ghsItemId'] = $data['itemId'];
+        $result = PicTextGhsItemClass::add($data);
+        if ($result) {
+            util::success($result);
+        }
+
+        util::fail('创建失败');
+    }
+
+    //更新花材描述(花材介绍)
+    public function actionUpdateDesc()
+    {
+        $form = new \ghs\models\item\CreateDescForm();
+        $form->load(Yii::$app->request->post(), '');
+        if (!$form->validateForm()) {
+            return;
+        }
+        $data = $form->attributes;
+        $id = $data['id'];
+        $info = PicTextGhsItemClass::getById($id, false, 'id');
+        if (empty($info)) {
+            util::fail('描述不存在');
+        }
+        $data['mainId'] = $this->mainId;
+        $result = PicTextGhsItemClass::updateById($id, $data);
+        if ($result) {
+            util::success($result);
+        }
+        util::fail('更新失败');
+    }
 }

+ 2 - 2
app-hd/controllers/MainController.php

@@ -84,7 +84,7 @@ class MainController extends BaseController
         $goodsImgUrl = miniUtil::generateUnlimitedMiniCode($merchant, $goodsPage, $scene, $ptStyle);
 
         $prefix = imgUtil::getPrefix();
-        $titleBase64 = stringUtil::ossBase64('扫码买花');
+        $titleBase64 = stringUtil::ossBase64('花束花篮');
 
         if ($pfShopId > 0) {
             $goodsUrl = $prefix . 'shop/miniCodeBg.jpg?x-oss-process=image';
@@ -171,7 +171,7 @@ class MainController extends BaseController
         $flowerImgUrl = miniUtil::generateUnlimitedMiniCode($merchant, $flowerPage, $scene, $ptStyle);
 
         $prefix = imgUtil::getPrefix();
-        $titleBase64 = stringUtil::ossBase64('扫码买花');
+        $titleBase64 = stringUtil::ossBase64('花材绿植');
 
         if ($pfShopId > 0) {
             $flowerUrl = $prefix . 'shop/miniCodeBg.jpg?x-oss-process=image';

+ 5 - 8
app-hd/controllers/ProductController.php

@@ -843,22 +843,19 @@ class ProductController extends BaseController
     public function actionGhsProductDetail()
     {
         $get = Yii::$app->request->get();
-        $id = isset($get['id']) ? intval($get['id']) : 0;
-        $ghsId = isset($get['ghsId']) ? intval($get['ghsId']) : 0;
-        if ($id == 0 || $ghsId == 0) {
-            util::fail('请求参数出错');
-        }
-
+        $id = $get['id'] ?? 0;
+        $ghsId = $get['ghsId'] ?? 0;
         $product = ProductClass::getById($id);
         if (empty($product)) {
             util::fail('没有花材信息');
         }
-        $ghsInfo = GhsClass::getById($ghsId, true, 'giveLevel, mainId');
+        $ghsInfo = GhsClass::getById($ghsId, true, 'giveLevel');
         $level = isset($ghsInfo->giveLevel) ? $ghsInfo->giveLevel : 1;
         $list = ProductClass::groupProductInfo([$product], $level);
         $product = current($list);
 
-        $pixTextGoods = PicTextGhsItemClass::getByCondition(['mainId' => $ghsInfo->mainId, 'ghsItemId' => $id], true);
+        $mainId = $product['mainId']??0;
+        $pixTextGoods = PicTextGhsItemClass::getByCondition(['mainId' => $mainId, 'ghsItemId' => $id], true);
         $product['picTextGoods'] = $pixTextGoods;
         // 封面图与多花材图片的兼容处理
         if ($product['images'] == '' && $product['shortCover'] != '') {

+ 1 - 0
app-hd/controllers/ShopController.php

@@ -58,6 +58,7 @@ class ShopController extends BaseController
         $fullName = $shop->shopName == '首店' ? $name : $name . ' ' . $shop->shopName;
         $shopId = $shop->id;
         HdClass::updateByCondition(['shopId' => $shopId], ['name' => $fullName]);
+        CustomClass::updateByCondition(['shopId' => $shopId], ['originName' => $fullName]);
         util::complete('修改成功');
     }
 

+ 5 - 1
app-mall/controllers/ChatController.php

@@ -74,7 +74,11 @@ class ChatController extends BaseController
     //客户的未读消息总数
     public function actionUnReadMsgCount()
     {
-        $c = ChatService::getUnReadMsgCount(intval($this->userId), 'message');
+        $c = 0;
+        //未登录也会访问这个接口
+        if ($this->userId > 0) {
+            $c = ChatService::getUnReadMsgCount($this->userId, 'message');
+        }
         util::success(['msg_count' => $c]);
     }
 

+ 3 - 0
biz-hd/purchase/classes/PurchaseClass.php

@@ -449,6 +449,9 @@ class PurchaseClass extends BaseClass
             'cargo_num' => $packageNum
         ];
         $customName = $custom->name ?? '';
+        if (empty($customName)) {
+            util::fail('客户名称是空的');
+        }
         $customMobile = $custom->mobile ?? '';
         if (empty($customMobile)) {
             util::fail('客户手机缺失');

+ 1 - 1
biz/shop/classes/ShopClass.php

@@ -37,7 +37,7 @@ class ShopClass extends BaseClass
         $address = $shop->address ?? '';
         $hasMap = dict::getDict('hasMap');
         if (getenv('YII_ENV') == 'production') {
-            $openIntraCityMainList = [50, 58668];
+            $openIntraCityMainList = [50, 58668, 24162];
         } else {
             $openIntraCityMainList = [644];
         }

+ 9 - 6
common/components/IntraCityExpress.php

@@ -332,12 +332,15 @@ class IntraCityExpress
      */
     public static function preAddOrder($orderData, $merchant = null, $ptStyle = 0)
     {
-        // 创建表单验证模型
-        $form = new StoreFeeForm();
-        $form->setScenario('query_fee');
-        $form->load($orderData, ''); // 直接从 post 数据加载,不使用模型名作为前缀
-        // 执行表单验证
-        $form->validateForm();
+
+        // 花好鲜鲜花批发(安海部) user_name会被阻挡,不要打开
+
+//        // 创建表单验证模型
+//        $form = new StoreFeeForm();
+//        $form->setScenario('query_fee');
+//        $form->load($orderData, ''); // 直接从 post 数据加载,不使用模型名作为前缀
+//        // 执行表单验证
+//        $form->validateForm();
 
         if ($merchant === null) {
             $merchant = self::getMerchant();