Ejemplo n.º 1
0
 function shopcontrol()
 {
     $this->checkmemberlogin();
     $controlname = trim(IFilter::act(IReq::get('controlname')));
     $orderid = intval(IReq::get('orderid'));
     $ordertempinfo = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "order where id = " . $orderid . "");
     if ($ordertempinfo['shopuid'] != $this->member['uid']) {
         $this->message('您不能操作此订单');
     }
     $shopid = $ordertempinfo['shopid'];
     $shopinfo = $this->mysql->select_one("select uid from " . Mysite::$app->config['tablepre'] . "shop where id = " . $shopid . "");
     switch ($controlname) {
         case 'unorder':
             $reason = trim(IFilter::act(IReq::get('reason')));
             if (empty($reason)) {
                 $this->message('关闭理由不能为空');
             }
             $ordercontrol = new ordercontrol($orderid);
             if ($ordercontrol->sellerunorder($shopinfo['uid'], $reason)) {
                 $this->success('操作成功');
             } else {
                 $this->message($ordercontrol->Error());
             }
             break;
         case 'sendorder':
             $ordercontrol = new ordercontrol($orderid);
             if ($ordercontrol->sendorder($shopinfo['uid'])) {
                 $this->success('操作成功');
             } else {
                 $this->message($ordercontrol->Error());
             }
             break;
         case 'shenhe':
             $ordercontrol = new ordercontrol($orderid);
             if ($ordercontrol->shenhe($shopinfo['uid'])) {
                 $this->success('操作成功');
             } else {
                 $this->message($ordercontrol->Error());
             }
             break;
         case 'delorder':
             $ordercontrol = new ordercontrol($orderid);
             if ($ordercontrol->sellerdelorder($shopinfo['uid'])) {
                 $this->success('操作成功');
             } else {
                 $this->message($ordercontrol->Error());
             }
             break;
         case 'domake':
             if ($ordertempinfo['status'] != 1) {
                 $this->message('订单状态不可操作是否制作');
             }
             if (!empty($ordertempinfo['is_make'])) {
                 $this->message('订单已设置过是否制作,如要取消 请联系网站客服');
             }
             $newdata['is_make'] = 1;
             $this->mysql->update(Mysite::$app->config['tablepre'] . 'order', $newdata, "id='" . $orderid . "'");
             $this->success('操作成功');
             break;
         case 'unmake':
             if ($ordertempinfo['status'] != 1) {
                 $this->message('订单状态不可操作是否制作');
             }
             if (!empty($ordertempinfo['is_make'])) {
                 $this->message('订单已设置过是否制作,如要取消 请联系网站客服');
             }
             $newdata['is_make'] = 2;
             $this->mysql->update(Mysite::$app->config['tablepre'] . 'order', $newdata, "id='" . $orderid . "'");
             $this->success('操作成功');
             break;
         default:
             $this->message('未定义的操作');
             break;
     }
 }
Ejemplo n.º 2
0
 function userdelorder()
 {
     $this->checkmemberlogin();
     $orderid = intval(IReq::get('orderid'));
     $ordercontrol = new ordercontrol($orderid);
     if (empty($this->member['uid'])) {
         $this->message('未登陆');
     }
     if ($ordercontrol->buyerdelorder($this->member['uid'])) {
         $this->success('操作成功');
     } else {
         $this->message($ordercontrol->Error());
     }
 }