feat: chef
This commit is contained in:
@@ -15,6 +15,7 @@ use App\Constants\Common\GoodCode;
|
||||
use App\Constants\Common\SiteCode;
|
||||
use App\Exception\ErrException;
|
||||
use App\Model\AdminUser;
|
||||
use App\Model\Chef;
|
||||
use App\Model\Cycle;
|
||||
use App\Model\Kitchen;
|
||||
use App\Model\Sku;
|
||||
@@ -166,6 +167,12 @@ class SpuService extends BaseService
|
||||
#[Inject]
|
||||
protected AdminUser $adminUserModel;
|
||||
|
||||
/**
|
||||
* @var Chef
|
||||
*/
|
||||
#[Inject]
|
||||
protected Chef $chefModel;
|
||||
|
||||
/**
|
||||
* 信息检测
|
||||
* @return void
|
||||
@@ -177,10 +184,11 @@ class SpuService extends BaseService
|
||||
|
||||
if ($kitchenInfo->status == SiteCode::KITCHEN_DISABLE) throw new ErrException('该厨房已禁用');
|
||||
|
||||
$chefId = $this->request->input('chef_id');
|
||||
$chefInfo = $this->adminUserModel->getAdminInfoById($chefId);
|
||||
$chefId = (int)$this->request->input('chef_id');
|
||||
$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('该厨师已禁用');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user