Example #1
0
 public function view_markLocalStatus_aliorder()
 {
     $ids = isset($_GET['msgids']) ? trim($_GET['msgids']) : '';
     $status = isset($_GET['status']) ? intval($_GET['status']) : 0;
     if (empty($ids)) {
         //没有传入id值
         $msgdata = array('errCode' => 10020, 'errMsg' => '请指定message!');
         echo json_encode($msgdata);
         exit;
     }
     if ($status == 0) {
         $msgdata = array('errCode' => 10021, 'errMsg' => '请指定状态!');
         echo json_encode($msgdata);
         exit;
     }
     if ($status == 1) {
         //标记为已经回复
         $status = 2;
     } else {
         if ($status == 2) {
             //标记为未回复
             $status = 0;
         } else {
             $msgdata = array('errCode' => 10024, 'errMsg' => '请指定正确的状态!');
             echo json_encode($msgdata);
             exit;
         }
     }
     $ids = clearData($ids);
     $msg_obj = new messageModel();
     $result = $msg_obj->updateMessageStatus_aliorder($ids, $status, $_SESSION['globaluserid'], time());
     //$result = $msg_obj->updateMessageStatus($ids, $status);//debug
     if ($result) {
         $msgdata = array('errCode' => 10023, 'errMsg' => '操作成功! ');
         echo json_encode($msgdata);
         exit;
     } else {
         $msgdata = array('errCode' => 10022, 'errMsg' => '操作失败!');
         echo json_encode($msgdata);
         exit;
     }
 }