feat : catering

This commit is contained in:
2025-03-14 10:05:12 +08:00
parent 3aa241350c
commit 747e37fc86
11 changed files with 210 additions and 18 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Service\ServiceTrait\Admin;
use App\Model\Caterer;
use App\Model\Chef;
use App\Model\DriverSequence;
use App\Model\WarehouseKeeper;
@@ -27,6 +28,12 @@ trait RoleMembersTrait
#[Inject]
protected WarehouseKeeper $warehouseKeeperModel;
/**
* @var Caterer
*/
#[Inject]
protected Caterer $catererModel;
/**
* @param int $id
* @param string $name
@@ -64,6 +71,19 @@ trait RoleMembersTrait
return $warehouseKeeper->save();
}
/**
* @param int $id
* @param int $type
* @return bool
*/
protected function addCaterer(int $id,int $type)
{
$caterer = new Caterer();
$caterer->user_id = $id;
$caterer->type = $type;
return $caterer->save();
}
/**
* @param int $id
* @return bool
@@ -93,4 +113,12 @@ trait RoleMembersTrait
return $this->warehouseKeeperModel->where('user_id', $id)->delete();
}
/**
* @param $id
* @return bool
*/
protected function delCaterer($id): bool
{
return $this->catererModel->where('user_id', $id)->delete();
}
}