コード例 #1
0
 public function menuGrade()
 {
     $menuId = decodeMenuId(intval($this->_post("menuId")));
     $orderId = decodeOrderId(intval($this->_post("orderId")));
     $grade = floatval($this->_post("grade"));
     //分数
     $remark = $this->_post("remark");
     //留言
     if (D("order_detail")->where("menu_id = {$menuId} AND order_id = {$orderId} AND is_grade = 0")->save(array("is_grade" => 1, "grade" => $grade, "remark" => $remark))) {
         $uid = session("uid");
         D("User")->addUserEvaluateCredit($orderId, $menuId);
         //增加用户积分
         D("UserLogs")->userLogs(10000, json_encode(array("order_id" => $orderId, "menu_id" => $menuId)));
         $this->ajaxReturn(array("responce" => "SUCCESS", "message" => "评分成功!"));
     } else {
         $this->ajaxReturn(array("responce" => "FAILED", "message" => "请先确认该订单是否存在!"));
     }
 }
コード例 #2
0
 public function rejectOrderByAdmin()
 {
     if (isset($_POST["__wx__"])) {
         session_id($this->_post("__wx__"));
     }
     session_start();
     $orderId = decodeOrderId(intval($this->_post("orderId")));
     $reason = $this->_post("reason");
     $orderPhone = $this->_post("orderPhone");
     $orderUserName = $this->_post("orderUserName");
     $shopId = M("order")->where("oid = {$orderId}")->getField("shop_id");
     if (D("Order")->boolOrderWithShop($shopId, $orderId)) {
         //   if ($this->sendRejectMessageToUser($orderPhone, $orderUserName, $reason)) {
         M("order")->where("oid = {$orderId}")->save(array("order_status" => 4, "reject_reason" => $reason));
         //确认订单
         $this->ajaxReturn(array("responce" => "SUCCESS", "message" => "拒绝成功!"));
         // }
     } else {
         $this->ajaxReturn(array("responce" => "FAILED", "message" => "您的餐厅没有该订单,请刷新后重试!"));
     }
 }
コード例 #3
0
 public function getOrderAndShopInfo()
 {
     //不验证登录
     $orderId = decodeOrderId(intval($this->_post("orderId")));
     $responce = M()->table("o_order as o, o_shop as s")->where("o.oid = {$orderId} AND s.shop_id = o.shop_id")->find();
     $responce['order_detail'] = M("order_detail")->where("order_id = {$orderId}")->select();
     $this->ajaxReturn($responce);
 }