evoxwht 2 лет назад
Родитель
Сommit
0e7c54c127

+ 10 - 0
crmeb/app/adminapi/controller/v1/user/User.php

@@ -170,6 +170,9 @@ class User extends AuthController
      * 获取用户账户详情
      * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function read($id)
     {
@@ -194,6 +197,9 @@ class User extends AuthController
      * 执行赠送会员等级
      * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function save_give_level($id)
     {
@@ -208,6 +214,7 @@ class User extends AuthController
      * 赠送付费会员时长表单
      * @param $id
      * @return mixed
+     * @throws \FormBuilder\Exception\FormBuilderException
      */
     public function give_level_time($id)
     {
@@ -219,6 +226,9 @@ class User extends AuthController
      * 执行赠送付费会员时长
      * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function save_give_level_time($id)
     {

+ 4 - 0
crmeb/app/api/controller/v1/store/CategoryController.php

@@ -28,7 +28,11 @@ class CategoryController
 
     /**
      * 获取分类列表
+     * @param Request $request
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function category(Request $request)
     {

+ 5 - 1
crmeb/app/api/controller/v2/user/UserInvoiceController.php

@@ -142,7 +142,11 @@ class UserInvoiceController
         $uid = (int)$request->uid();
         $re = $this->services->saveInvoice($uid, $data);
         if ($re) {
-            return app('json')->success($re['type'] == 'edit' ? 100001 : $re['data']);
+            if ($re['type'] == 'edit') {
+                return app('json')->success(100001);
+            } else {
+                return app('json')->success(100021, $re['data']);
+            }
         } else {
             return app('json')->fail(100005);
         }

+ 2 - 0
crmeb/app/dao/user/UserDao.php

@@ -82,7 +82,9 @@ class UserDao extends BaseDao
 
     /**
      * @param $uid
+     * @param string $field
      * @return \think\Collection
+     * @throws \ReflectionException
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException

+ 7 - 4
crmeb/app/services/product/product/StoreCategoryServices.php

@@ -107,17 +107,16 @@ class StoreCategoryServices extends BaseServices
 
     /**
      * 设置分类状态
-     * @param $id
-     * @param $is_show
+     * @param int $id
+     * @param int $is_show
      */
     public function setShow(int $id, int $is_show)
     {
         $res = $this->dao->update($id, ['is_show' => $is_show]);
         $res = $res && $this->dao->update($id, ['is_show' => $is_show], 'pid');
+        $this->cacheDriver()->clear();
         if (!$res) {
             throw new AdminException(100005);
-        } else {
-            $this->cacheDriver()->clear();
         }
     }
 
@@ -184,6 +183,10 @@ class StoreCategoryServices extends BaseServices
     /**
      * 保存新增数据
      * @param $data
+     * @return int
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function createData($data)
     {

+ 3 - 0
crmeb/app/services/user/UserAddressServices.php

@@ -82,6 +82,9 @@ class UserAddressServices extends BaseServices
      * @param int $uid
      * @param string $field
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getUserDefaultAddress(int $uid, string $field = '*')
     {

+ 3 - 1
crmeb/app/services/user/UserLabelRelationServices.php

@@ -47,8 +47,10 @@ class UserLabelRelationServices extends BaseServices
 
     /**
      * 用户设置标签
-     * @param int $uid
+     * @param $uids
      * @param array $labels
+     * @return bool
+     * @throws \Exception
      */
     public function setUserLable($uids, array $labels)
     {

+ 11 - 2
crmeb/app/services/user/UserLabelServices.php

@@ -40,6 +40,9 @@ class UserLabelServices extends BaseServices
      * 获取某一本标签
      * @param $id
      * @return array|\think\Model|null
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getLable($id)
     {
@@ -110,6 +113,9 @@ class UserLabelServices extends BaseServices
      * @param int $id
      * @param array $data
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function save(int $id, array $data)
     {
@@ -144,8 +150,11 @@ class UserLabelServices extends BaseServices
 
     /**
      * 删除
-     * @param $id
-     * @throws \Exception
+     * @param int $id
+     * @return bool
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function delLabel(int $id)
     {