Przeglądaj źródła

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

shish 5 lat temu
rodzic
commit
02ffd5c7e8

+ 1 - 0
app-ghs/controllers/ProductController.php

@@ -96,6 +96,7 @@ class ProductController extends BaseController
         $showPage = Yii::$app->request->get('showPage', 0);
         if ($showPage) {
             $respond = ProductClass::getList("*", $where, "inTurn desc");
+            $respond['list'] = ProductClass::groupProductInfo($respond['list']);
             util::success($respond);
         }
         $data = ProductClass::getAllByCondition($where, "inTurn desc", "*");

+ 10 - 1
app-ghs/controllers/ShopAdminController.php

@@ -2,6 +2,7 @@
 
 namespace ghs\controllers;
 
+use biz\admin\classes\AdminClass;
 use bizHd\wx\classes\WxOpenClass;
 use bizGhs\shop\classes\ShopAdminClass;
 use bizGhs\admin\services\AdminRoleService;
@@ -118,6 +119,14 @@ class ShopAdminController extends BaseController
         $relation->status = $status;
         $relation->save();
         ShopAdminClass::valid($relation, $this->shopId);
+        //若有传密码,则修改密码
+        $password = $post['password']??'';
+        if(!empty($password)){
+            $adminId = $relation->adminId;
+            $password = password_hash($password, PASSWORD_BCRYPT);
+            AdminClass::updateById($adminId,['password'=>$password]);
+        }
+
         util::complete('修改成功');
     }
 
@@ -134,4 +143,4 @@ class ShopAdminController extends BaseController
         util::complete();
     }
 
-}
+}

+ 6 - 1
biz/item/classes/PtItemClass.php

@@ -186,7 +186,12 @@ class PtItemClass extends BaseClass
             }
             $upData['smallUnit'] = $data['smallUnit'];
         }
-
+        if (isset($data['classId'])) {
+            if (empty($data['classId'])) {
+                util::fail("请选择花材分类");
+            }
+            $upData['classId'] = $data['classId'];
+        }
 
         unset($data['id']);
         if (empty($upData)) {

+ 9 - 2
biz/sj/services/MerchantService.php

@@ -74,7 +74,14 @@ class MerchantService extends BaseService
         $applyData['agentLevel'] = 1;
         $applyData['parentId'] = $applyData['introSjId'] ?? 0;
         //15天免费试用
-        $deadline = time() + 15 * 86400;
+        //区分供货商(一年) 零售商(15天)
+        $deadline = time() + 7 * 86400; //默认其他
+        if ($applyData['style'] == SjClass::STYLE_RETAIL){
+            $deadline = time() + 15 * 86400; //零售商(15天)
+        }
+        if ($applyData['style'] == SjClass::STYLE_SUPPLIER){
+            $deadline = time() + 365 * 86400; //区分供货商(一年)
+        }
         $applyData['deadline'] = date("Y-m-d H:i:s", $deadline);
         $sj = self::add($applyData);
         $sjId = $sj['id'];
@@ -343,4 +350,4 @@ class MerchantService extends BaseService
         return MerchantClass::getH5MallQrCode($id);
     }
 
-}
+}