getMessage(), 500); } } /** * Notes:修改产品 * @param array $param * @return int * User: QJF * Date: 2022/9/23 */ public static function updateMent($param) { SystemRole::affairBegin(); try { $where = []; $where['appointment_id'] = $param['appointment_id']; $result = Appointment::where($where)->update($param); if ($result !== false){ SystemRole::affairCommit(); return true; } throw new \Exception('操作失败!'); }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:删除产品 * @param int $role_id * @return int * User: QJF * Date: 2022/9/23 */ public static function delMent($appointment_id) { SystemRole::affairBegin(); try { $where = []; $where['appointment_id'] = $appointment_id; $data['appointment_del'] = 1; $result = Appointment::where($where)->update($data); if (!empty($result)){ SystemRole::affairCommit(); return true; }else{ return false; } }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:上/下架 * @param int $role_id * @return int * User: QJF * Date: 2022/9/28 */ public static function showMent($appointment_id,$appointment_status) { $where = []; $where['appointment_id'] = $appointment_id; $data['appointment_status'] = $appointment_status; $result = Appointment::where($where)->update($data); if (!empty($result)){ return true; }else{ return false; } } /** * Notes:产品详情 * @param int $package_id * @return int * User: QJF * Date: 2022/9/23 */ public static function infoMent($appointment_id) { SystemRole::affairBegin(); try { $where = []; $where['appointment_id'] = $appointment_id; $result = Appointment::with(['Category','Shop'])->where($where)->first(); if (!empty($result)){ SystemRole::affairCommit(); return $result; }else{ return false; } }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } }