public function run($id) { $nurse_info = NurseUser::model()->findByPk($id); if ($nurse_info->delete()) { $this->controller->success(''); } }
public function run($nurser_id, $order_id) { //throw new RuntimeException($nurser_id); $order_model = Order::model()->findByPk($order_id); if (!empty($order_model->nurser_id)) { $id = $order_model->nurser_id; $nurser_model = NurseUser::model()->findByPk($id); $nurser_model->status = 0; if (!$nurser_model->update()) { throw new RuntimeException("数据保存失败"); } } //确认护士,并改成护士值班状态 $order_model->nurser_id = $nurser_id; $nurse_model = NurseUser::model()->findBypk($nurser_id); //选择后护士状态呈现已安排 $nurse_model->status = 1; //throw new RuntimeException($phone); $order_model->order_status = 1; if ($order_model->update() && $nurse_model->update()) { $flag = 0; //$phone = $nurse_model->phone; //$message = "橙妈妈用户已下单,请您在30分钟内确认订单..."; //SmsCode::SendMsgs($phone,$message); } else { $flag = 1; } $vars = array('nurser_id' => $nurser_id, 'order_id' => $order_id, 'flag' => $flag); $this->controller->success('', $vars); }
public function run() { $order_id = Yii::app()->request->getParam('order_id', 0); //echo $order_id;die; $nurse_model = NurseUser::getNOList(); $vars = array('nurse_model' => $nurse_model, 'order_id' => $order_id); $this->controller->render('select', $vars); }
public function run() { $order_model = Order::getOrderList(); $nurser = NurseUser::getNOList(); //print_r($order_model);die; $vars = array('order_model' => $order_model); $this->controller->render('index', $vars); }
public function run() { $txt = Yii::app()->request->getParam('txt', 0); if (empty($txt)) { $this->controller->redirect('/mama/nurseuser/index'); } $nurse_info = NurseUser::findSearch($txt); $this->controller->render('search', array('nurse_info' => $nurse_info)); }
public function run() { // $com_id = $this->controller->comId; // echo $com_id; // exit(); $nurse_model = NurseUser::getList(); $com_id = $this->controller->comId; $vars = array('nurse_model' => $nurse_model); $this->controller->render('index', $vars); }
public function run() { $id = Yii::app()->request->getParam('id', 0); $nurseUser_model = NurseUser::model()->findByPk($id); $itemrealte_model = ItemRelate::model(); $item_model = Item::getList(); //定义性别信息 $sex = array('0' => '男', '1' => '女'); //定义服务信息 $item = array(); foreach ($item_model as $V) { $item[$V['id']] = $V['name']; } if (isset($_POST['NurseUser'])) { $nurseUser_model->attributes = $_POST['NurseUser']; //文件上传 $file = CUploadedFile::getInstance($nurseUser_model, 'thumb'); //获取表单名为thumb的上传信息 if (is_object($file) && get_class($file) === 'CUploadedFile') { $filename = date("YmdHis") . '_' . rand(0, 9999) . '.' . $file->extensionName; //获取文件名 $nurseUser_model->thumb = '/images/weimob/' . $filename; //数据库中要存放文件名 $uploadfile = './images/weimob/' . $filename; $file->saveAs($uploadfile, true); //上传操作 } if ($nurseUser_model->save()) { if (isset($_POST['ItemRelate'])) { $nurser_id = $nurseUser_model->id; if (ItemRelate::findByNurseId($nurser_id)) { $itemrealte_model->deleteAll('nurser_id=:nurser_id', array(':nurser_id' => $nurser_id)); } foreach ($_POST['ItemRelate']['item_id'] as $V) { $_POST['ItemRelate']['item_id'] = $V; $_POST['ItemRelate']['nurser_id'] = $nurser_id; //克隆新对象,防止覆盖前面保存的数据 $_itemrealte_model = clone $itemrealte_model; $_itemrealte_model->isNewRecord = true; //新纪录,执行插入操作 $_itemrealte_model->attributes = $_POST['ItemRelate']; $_itemrealte_model->save(); } } $this->controller->redirect('/mama/nurseuser/index'); } } $var = array('sex' => $sex, 'nurseUser_model' => $nurseUser_model, 'itemrealte_model' => $itemrealte_model, 'item' => $item); $this->controller->render('update', $var); }
public function run($status, $id) { $nurseruser_info = NurseUser::model()->findByPk($id); if ($status == 0) { $nurseruser_info->status = 1; } else { $nurseruser_info->status = 0; } if ($nurseruser_info->update()) { $flag = 0; } else { $flag = 1; } $vars = array('flag' => $flag); $this->controller->success('', $vars); }
public function run($id) { $model = Order::model()->findByPk($id); $nurser_id = $model->nurser_id; $nurse_model = NurseUser::model()->findByPk($nurser_id); //完成订单后,护士状态呈现未安排 $nurse_model->status = 0; $model->order_status = 2; if ($model->update() && $nurse_model->update()) { $flag = 0; } else { $flag = 1; } $vars = array('flag' => $flag); $this->controller->success('', $vars); }
public function run($nurser_id, $order_id) { $order_model = Order::model()->findByPk($order_id); //确认护士,并改成护士值班状态 $order_model->nurser_id = $nurser_id; $nurse_model = NurseUser::model()->findBypk($nurser_id); //选择后护士状态呈现已安排 $nurse_model->status = 1; //确认订单,改变状态 $order_model->order_status = 1; if ($order_model->update() && $nurse_model->update()) { $flag = 0; } else { $flag = 1; } $vars = array('nurser_id' => $nurser_id, 'order_id' => $order_id, 'flag' => $flag); $this->controller->success('', $vars); }
<td><?php echo StrCut::truncate_utf8_string($_V['remark'], 10); ?> </td> <td><?php echo StrCut::truncate_utf8_string($_V['address'], 10); ?> </td> <td><?php echo $_V['book_time']; ?> </td> <td> <?php if (!empty($_V['nurser_id'])) { $nuder_model = NurseUser::model()->findByPk($_V['nurser_id']); echo $nuder_model['name']; } else { echo '<div style="color:red;">未选择护士</div>'; } ?> </td> <td> <?php if ($_V['order_status'] == 0) { echo '<div style="color:red;">未接单</div>'; } else { if ($_V['order_status'] == 1) { echo '<div style="color:blue;">已接单</div>'; } else { if ($_V['order_status'] == 2) {