feat:chef
This commit is contained in:
@@ -17,6 +17,7 @@ use App\Extend\StringUtil;
|
||||
use App\Lib\Crypto\CryptoFactory;
|
||||
use App\Model\AdminRole;
|
||||
use App\Model\AdminUser;
|
||||
use App\Model\Chef;
|
||||
use App\Model\DriverSequence;
|
||||
use App\Service\Admin\BaseService;
|
||||
use Exception;
|
||||
@@ -109,6 +110,8 @@ class EmployeeService extends BaseService
|
||||
(new DriverSequence)->insert([
|
||||
'driver_id' => $model->id,
|
||||
]),
|
||||
RoleCode::CHEF =>
|
||||
$this->addChef($model->id),
|
||||
default => true,
|
||||
};
|
||||
|
||||
@@ -117,6 +120,13 @@ class EmployeeService extends BaseService
|
||||
return $this->return->success();
|
||||
}
|
||||
|
||||
public function addChef($id): bool
|
||||
{
|
||||
$chef = new Chef();
|
||||
$chef->user_id = $id;
|
||||
return $chef->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @return array
|
||||
|
||||
Reference in New Issue
Block a user