Bladeren bron

手机端优化订单(删除服务订单)

wufeng 2 jaren geleden
bovenliggende
commit
7bd6233693

+ 0 - 14
app/mobile/controller/Service.php

@@ -22,19 +22,5 @@ class Service extends BaseController
         return ServiceLogic::read($id);
     }
 
-    //服务订单列表
-    public function orderList()
-    {
-        $param = $this->request->only(['page' => 1, 'size' => 10, 'status' => ''], 'post');
-        return ServiceLogic::orderList($param);
-    }
-
-    //服务订单详情
-    public function orderInfo()
-    {
-        $id = $this->request->post('id/d', 0);
-        return ServiceLogic::orderInfo($id);
-    }
-
 
 }

+ 3 - 3
app/mobile/logic/OrderLogic.php

@@ -312,7 +312,7 @@ class OrderLogic extends BaseLogic
         $count = $db->count('id');
 
         $list = $db
-            ->field('id,masterOrderCode,amount,status,addtime')
+            ->field('id,masterOrderCode,amount,status,addtime,type')
             ->append(['order_list'])
             ->withAttr('order_list', function ($val, $da) {
                 return OrderModel::field('id,orderCode,child_title,price,num,total_price')
@@ -334,8 +334,8 @@ class OrderLogic extends BaseLogic
     public static function info(int $id = 0): Json
     {
         $rs = MasterOrderModel::alias('a')
-            ->field('a.id,a.masterOrderCode,a.amount,a.status,a.addtime,c.contactor,c.mobile,c.addr,c.addr_code,a.transaction_id,a.remark')
-            ->leftJoin('addr c', 'c.id=a.addr_id AND c.is_del=' . CommonModel::$del_normal)
+            ->field('a.id,a.masterOrderCode,a.amount,a.status,a.addtime,c.contactor,c.mobile,c.addr,c.addr_code,a.transaction_id,a.remark,a.type')
+            ->leftJoin('addr c', 'c.id=a.addr_id')
             ->append(['order_list', 'express_data'])
             ->withAttr('order_list', function ($val, $da) {
                 return OrderModel::field('id,orderCode,child_title,child_cover,price,num,total_price,post_code')

+ 1 - 50
app/mobile/logic/ServiceLogic.php

@@ -2,15 +2,9 @@
 
 namespace app\mobile\logic;
 
-use app\model\AccountModel;
-use app\model\AccountTokenModel;
+
 use app\model\CommonModel;
-use app\model\OrderServiceModel;
 use app\model\ServiceModel;
-use app\model\VideoModel;
-use think\Exception;
-use think\facade\Config;
-use think\facade\Db;
 use think\response\Json;
 
 class ServiceLogic extends BaseLogic
@@ -48,47 +42,4 @@ class ServiceLogic extends BaseLogic
 
     }
 
-
-    //订单列表
-    public static function orderList(array $data = []): Json
-    {
-        $db = OrderServiceModel::alias('a')
-            ->leftJoin('service b', 'b.id=a.service_id AND b.is_del=' . CommonModel::$del_normal)
-            ->where(['a.is_del' => CommonModel::$del_normal, 'a.uid' => self::$aid]);
-
-        if ($data['status'] != '') $db->where('a.status', $data['status']);
-
-        $count = $db->count('a.id');
-
-        $list = $db
-            ->field('a.id,a.orderCode,b.title,a.num,a.status,a.addtime,a.type,a.price,a.total_price')
-            ->page($data['page'], $data['size'])
-            ->order('a.id', 'desc')
-            ->select()
-            ->toArray();
-
-        return json_show(CommonModel::$success, '获取服务订单列表成功', ['count' => $count, 'list' => $list]);
-
-    }
-
-    //订单详情
-    public static function orderInfo(int $id = 0): Json
-    {
-        $rs = OrderServiceModel::alias('a')
-            ->field('a.id,a.orderCode,a.status,a.addtime,a.type,b.title,a.num,c.contactor,c.mobile,c.addr,c.addr_code,a.price,a.total_price,a.post_name,a.post_code,a.remark,"支付流水号" p')
-            ->leftJoin('service b', 'b.id=a.service_id AND b.is_del=' . CommonModel::$del_normal)
-            ->leftJoin('addr c', 'c.id=a.addr_id AND c.is_del=' . CommonModel::$del_normal)
-            ->leftJoin('pay_info d', 'd.id=a.pay_info_id')
-            ->where(['a.is_del' => CommonModel::$del_normal, 'a.id' => $id, 'a.uid' => self::$aid])
-            ->withAttr('addr', function ($val, $da) {
-                return $da['addr_code'] ? get_addr_name($da['addr_code']) . $val : $val;
-            })
-            ->findOrEmpty()
-            ->toArray();
-
-        return $rs ? json_show(CommonModel::$success, '获取服务订单详情成功', $rs) : json_show(CommonModel::$error_param, '该服务订单不存在');
-
-    }
-
-
 }

+ 0 - 2
app/mobile/route/app.php

@@ -29,8 +29,6 @@ Route::rule('addrDelete', 'Addr/delete');//删除
 //【服务和商品】
 Route::rule('serviceList', 'Service/list');//服务列表
 Route::rule('serviceRead', 'Service/read');//服务详情
-Route::rule('serviceOrderList', 'Service/orderList');//服务订单列表
-Route::rule('serviceOrderInfo', 'Service/orderInfo');//服务订单详情
 
 Route::rule('goodList', 'Good/goodList');//商品列表
 Route::rule('goodInfo', 'Good/goodInfo');//商品详情

+ 0 - 12
app/model/OrderServiceModel.php

@@ -1,12 +0,0 @@
-<?php
-
-namespace app\model;
-
-use think\Model;
-
-class OrderServiceModel extends Model
-{
-    protected $table = 'fc_order_service';
-    protected $pk = 'id';
-
-}