driver_id = $id; $insertModel->driver_name = $name; return $insertModel->save(); } /** * 添加厨师 * @param $id * @return bool */ protected function addChef($id): bool { $chef = new Chef(); $chef->user_id = $id; return $chef->save(); } /** * 添加仓管 * @param $id * @return bool */ protected function addWarehouseKeeper($id): bool { $warehouseKeeper = new WarehouseKeeper(); $warehouseKeeper->user_id = $id; 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 */ protected function delDriver(int $id): bool { return $this->driverSequenceModel->where('driver_id', $id)->delete(); } /** * 添加厨师 * @param $id * @return bool */ protected function delChef($id): bool { return $this->chefModel->where('user_id', $id)->delete(); } /** * 添加仓管 * @param $id * @return bool */ protected function delWarehouseKeeper($id): bool { 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(); } }