workerOrderList($this->orgId,$status,$page,$size,$this->userId); HelpHander::success($res,'操作成功'); } //护工工单详情 public function todoDetail(){ $id = input('id',0); $model = new \app\common\model\PhOrders(); $res = $model->todoDetail($id); HelpHander::success($res,'操作成功'); } //调度订单列表 public function orderList(){ $page = input('page',1); $size = input('size',10); $status = input('status/d',-1); $model = new \app\common\model\PhOrders(); $res = $model->orderList1($this->orgId,$status,$page,$size); HelpHander::success($res,'操作成功'); } //订单详情 public function detail(){ $id = input('id/d',''); $model = new \app\common\model\PhOrders(); $ret = $model->getInfo($id); HelpHander::success($ret,'操作成功'); } //取消订单 public function cancel(){ $note = input('cancelReason','','trim'); $id = input('id/d',0); $model = new \app\common\model\PhOrders(); $ret = $model->cancelOrder($id,$note,$this->userId); if(!$ret){ HelpHander::error($model->getError()); }else{ HelpHander::success([],'操作成功'); } } //确认完成 public function finish(){ $model = new \app\common\model\PhOrders(); $res = $model->finishSave($this->userId,$this->orgId); if($res){ HelpHander::success([],'操作成功'); }else{ HelpHander::error($model->getError()); } } //发单 public function add(){ $model = new \app\common\model\PhOrders(); $res = $model->addSave($this->userId,$this->orgId,1); if($res){ HelpHander::success([],'操作成功'); }else{ HelpHander::error($model->getError()); } } public function send(){ $model = new \app\common\model\PhOrders(); $res = $model->sendSave($this->userId,$this->orgId); if($res){ HelpHander::success([],'操作成功'); }else{ HelpHander::error($model->getError()); } } public function getWorkerAll(){ $model = new Worker(); $ret = $model->getAllByOrg($this->orgId); HelpHander::success($ret,'成功'); } public function payOrder(){ $id = input('id/d',0); $remark = input('remark','','trim'); $money = input('money/f',0); if($money <= 0){ HelpHander::error('输入金额错误'); } $res = model('PhOrderPay')->addSaveDispatch($this->orgId,$id,$money,$remark); if($res){ HelpHander::success([],'操作成功'); }else{ HelpHander::error(model('PhOrderPay')->getError()); } } /** * 退款 */ public function refund(){ $res = model('PhOrderPay')->refundOrder($this->userId); if($res){ HelpHander::success([],'操作成功'); }else{ HelpHander::error(model('PhOrderPay')->getError()); } } public function payInfo(){ $id = input('id/d',0); $pay = Db::name('ph_order_pay')->where('id',$id)->find(); if(!$pay){ HelpHander::error('记录不存在'); } HelpHander::success($pay,'成功'); } }