123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <?php
- namespace app\admin\server\medical;
- use app\admin\model\Appointment;
- use app\admin\model\MedicalCareOrder;
- use app\admin\model\MedicalCareOrderProduct;
- use app\admin\model\MedicalCarePostage;
- use app\admin\model\PackageOrderDetail;
- use app\admin\model\SystemAdmin;
- use app\admin\model\SystemMenu;
- use app\admin\model\SystemRole;
- class AppointmentServer
- {
- /**
- * Notes:获取订单列表
- * @param string $keywords
- * @param int $page
- * @param int $limit
- * @return array
- * User: QJF
- * Date: 2022/9/17
- */
- public static function getMentList(int $page, int $limit, string $keywords)
- {
- [$list, $count] = Appointment::geMentList($page, $limit,$keywords);
- return compact('list', 'page', 'limit', 'count');
- }
- /**
- * Notes: 添加m模板
- * @param array $param
- * @return int
- * User: QJF
- * Date: 2022/9/28
- */
- public static function insertMent(array $param)
- {
- SystemRole::affairBegin();
- try {
- $param['appointment_create_time'] = time();
- $param['appointment_auto'] = 1;
- $result = Appointment ::insertGetId($param);
- if (!empty($result)){
- SystemRole::affairCommit();
- return $result;
- }
- throw new \Exception('操作失败!');
- }catch (\Exception $exception){
- SystemRole::affairRollback();
- throw new \Exception($exception->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);
- }
- }
- }
|