feat: chef

This commit is contained in:
2025-01-14 15:21:18 +08:00
parent 6365c47907
commit 78cb99a6d2

View File

@@ -15,6 +15,7 @@ use App\Constants\Common\GoodCode;
use App\Constants\Common\SiteCode; use App\Constants\Common\SiteCode;
use App\Exception\ErrException; use App\Exception\ErrException;
use App\Model\AdminUser; use App\Model\AdminUser;
use App\Model\Chef;
use App\Model\Cycle; use App\Model\Cycle;
use App\Model\Kitchen; use App\Model\Kitchen;
use App\Model\Sku; use App\Model\Sku;
@@ -166,6 +167,12 @@ class SpuService extends BaseService
#[Inject] #[Inject]
protected AdminUser $adminUserModel; protected AdminUser $adminUserModel;
/**
* @var Chef
*/
#[Inject]
protected Chef $chefModel;
/** /**
* 信息检测 * 信息检测
* @return void * @return void
@@ -177,10 +184,11 @@ class SpuService extends BaseService
if ($kitchenInfo->status == SiteCode::KITCHEN_DISABLE) throw new ErrException('该厨房已禁用'); if ($kitchenInfo->status == SiteCode::KITCHEN_DISABLE) throw new ErrException('该厨房已禁用');
$chefId = $this->request->input('chef_id'); $chefId = (int)$this->request->input('chef_id');
$chefInfo = $this->adminUserModel->getAdminInfoById($chefId); $chefInfo = $this->chefModel->getInfoById($chefId);
$chefUserInfo = $this->adminUserModel->getAdminInfoById($chefInfo->user_id);
if ($chefInfo->status == UserCode::DISABLE) throw new ErrException('该厨师已禁用'); if ($chefUserInfo->status == UserCode::DISABLE) throw new ErrException('该厨师已禁用');
} }
/** /**