修复权限缓存的问题,修复拆分的订单无法正常核销的问题

This commit is contained in:
吴昊天 2023-03-21 15:14:32 +08:00
parent 7feb20435f
commit 5ae976edc6
2 changed files with 11 additions and 5 deletions

View File

@ -80,12 +80,12 @@ class SystemRole extends AuthController
$data['rules'] = implode(',', $data['rules']);
if ($id) {
if (!$this->services->update($id, $data)) return app('json')->fail(100007);
CacheService::clear();
$this->services->cacheDriver()->clear();
return app('json')->success(100001);
} else {
$data['level'] = $this->adminInfo['level'] + 1;
if (!$this->services->save($data)) return app('json')->fail(400223);
CacheService::clear();
$this->services->cacheDriver()->clear();
return app('json')->success(400222);
}
}
@ -123,7 +123,7 @@ class SystemRole extends AuthController
if (!$this->services->delete($id))
return app('json')->fail(100008);
else {
CacheService::clear();
$this->services->cacheDriver()->clear();
return app('json')->success(100002);
}
}
@ -145,7 +145,7 @@ class SystemRole extends AuthController
}
$role->status = $status;
if ($role->save()) {
CacheService::clear();
$this->services->cacheDriver()->clear();
return app('json')->success(100001);
} else {
return app('json')->fail(100007);

View File

@ -49,7 +49,13 @@ class StoreOrderWriteOffServices extends BaseServices
*/
public function writeOffOrder(string $code, int $confirm, int $uid = 0)
{
$orderInfo = $this->dao->getOne(['verify_code' => $code, 'paid' => 1, 'refund_status' => 0, 'is_del' => 0]);
$orderInfo = $this->dao->getOne([
['verify_code', '=', $code],
['paid', '=', 1],
['refund_status', '=', 0],
['is_del', '=', 0],
['pid', '>=', 0]
]);
if (!$orderInfo) {
throw new ApiException(410173);
}