save($data); } /** * @notes:详情 * @throws BaseException * @author: wanghousheng */ public static function info($with = []) { $userId = UserService::getCurrentLoginUserId(); return self::detail(['user_id' => $userId], $with); } /** * @notes:更新记录 * @param array $data * @return bool * @throws BaseException * @author: wanghousheng */ public function edit(array $data): bool { $info = self::info(); empty($info) && throwError('申请记录不存在'); $info = $info->toArray(); if ($info['status'] == WholesalerEnum::ADOPT) { throwError('申请已通过无法编辑'); } $userId = UserService::getCurrentLoginUserId(); if ($this->where(['user_id' => $userId])->save($data) !== false) { return true; } return false; } }