优化方法注释

This commit is contained in:
evoxwht 2023-03-27 14:08:02 +08:00
parent 974459ed10
commit 0e7c54c127
8 changed files with 45 additions and 8 deletions

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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);
}

View File

@ -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

View File

@ -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)
{

View File

@ -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 = '*')
{

View File

@ -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)
{

View File

@ -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)
{