/** * 工单评价 */ public function actionEvaluate() { $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object'); $this->_modelWorkOrderDetail = $this->_getGlobalData('Model_WorkOrderDetail', 'object'); $workOrderId = $_POST['id']; $ev = $_POST['ev']; $workOrder = $this->_modelWorkOrder->findById($workOrderId); if (!$workOrder) { //未找到工单 $this->_returnAjaxJson(array('status' => 0, 'info' => 'work order non-existent', 'data' => null)); } if ($workOrder['evaluation_status'] != '0') { //工单已经评价 $this->_returnAjaxJson(array('status' => 0, 'info' => 'already evaluation', 'data' => null)); } $this->_modelWorkOrder->update(array('evaluation_status' => $ev), "Id={$workOrderId}"); if ($ev == 3 && !empty($_POST['des'])) { //如果等于3,而且留言不为空.将获取用户填的资料 $workOrderDetail = $this->_modelWorkOrderDetail->findByWorkOrderId($workOrderId); $detail = unserialize($workOrderDetail['content']); $detail['other']['ev'] = $_POST['des']; $detail = serialize($detail); $this->_modelWorkOrderDetail->update(array('content' => $detail), "work_order_id={$workOrderId}"); } $this->_returnAjaxJson(array('status' => 1, 'info' => null, 'data' => null)); }
private function _documentAdd() { if ($this->_isPost()) { $this->_modelQualityDocument = $this->_getGlobalData('Model_QualityDocument', 'object'); $data = $this->_modelQualityDocument->add($_POST); $this->_utilMsg->showMsg($data['msg'], $data['status'], $data['href']); } else { $orgList = Model::getTtwoArrConvertOneArr($this->_getGlobalData('org'), 'Id', 'name'); //组列表 $users = Model::getTtwoArrConvertOneArr($this->_getGlobalData('user'), 'Id', 'nick_name'); //用户列表 $source = $this->_getGlobalData('verify_source'); //来源 $socres = Tools::getLang('QUALITY_SOURCE', 'Common'); //分数 $feedBack = array('1' => '是', '0' => '否'); $verifyStatus = $this->_getGlobalData('verify_status'); if ($_GET['Id']) { $workOrderId = Tools::coerceInt($_GET['work_order_id']); $qaId = Tools::coerceInt($_GET['qa_id']); $id = Tools::coerceInt($_GET['Id']); $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object'); $this->_utilRbac = $this->_getGlobalData('Util_Rbac', 'object'); $this->_modelQuality = $this->_getGlobalData('Model_Quality', 'object'); $qualityDetail = $this->_modelQuality->findById($id); $userClass = $this->_utilRbac->getUserClassById($qualityDetail['reply_user_id']); $workOrderDetail = $this->_modelWorkOrder->findById($workOrderId); $selected = array(); $selected['title'] = $workOrderDetail['title']; $selected['source'] = $workOrderDetail['source']; $selected['org_id'] = $userClass['_orgId']; $selected['reply_user_id'] = $qualityDetail['reply_user_id']; $selected['quality_user_id'] = $qualityDetail['quality_user_id']; $selected['option_id'] = $qualityDetail['option_id']; $selected['scores'] = $qualityDetail['scores']; $this->_view->assign('selected', $selected); } $this->_view->assign('verifyStatus', $verifyStatus); $this->_view->assign('orgList', $orgList); $this->_view->assign('users', $users); $this->_view->assign('source', $source); $this->_view->assign('socres', $socres); $this->_view->assign('feedBack', $feedBack); $this->_utilMsg->createNavBar(); $this->_view->set_tpl(array('body' => 'QualityCheck/DocumentAdd.html')); $this->_view->display(); } }
/** * 工单评价 */ public function actionEvaluate() { $this->_modelWorkOrder = $this->_getGlobalData('Model_WorkOrder', 'object'); $this->_modelWorkOrderDetail = $this->_getGlobalData('Model_WorkOrderDetail', 'object'); $workOrderId = intval($_REQUEST['id']); $ev = intval($_REQUEST['ev']); //不在范围的评价状态,默认好评 if ($ev < 1 || $ev > 3) { $ev = 1; } $workOrder = $this->_modelWorkOrder->findById($workOrderId); if (!$workOrder) { //未找到工单 $this->_returnAjaxJson(array('status' => 0, 'info' => 'work order non-existent', 'data' => null)); } if ($workOrder['status'] != '3') { //尚未已处理 $this->_returnAjaxJson(array('status' => 0, 'info' => 'status forbidden', 'data' => null)); } if ($workOrder['evaluation_status'] != '0') { //工单已经评价 $this->_returnAjaxJson(array('status' => 0, 'info' => 'already evaluation', 'data' => null)); } $updateArr = array('evaluation_status' => $ev); if ($ev == 3) { //如果等于3就表示不满意,将更新字段 $des = intval($_REQUEST['des']); $updateArr['evaluation_desc'] = $des ? $des : 6; //默认其他 } $this->_modelWorkOrder->update($updateArr, "Id={$workOrderId}"); #------追加日志------# $this->_modelOrderLog = $this->_getGlobalData('Model_OrderLog', 'object'); $this->_modelOrderLog->addLog(array('Id' => $workOrderId), Model_OrderLog::EV); #------追加日志------# $this->_returnAjaxJson(array('status' => 1, 'info' => 'InterfaceWorkOrder_Evaluate', 'data' => null)); }