|
@@ -5,6 +5,7 @@ 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;
|
|
@@ -49,33 +50,33 @@ class ServiceLogic extends BaseLogic
|
|
|
|
|
|
|
|
|
//订单列表
|
|
|
- public static function list(array $data = []): Json
|
|
|
+ public static function orderList(array $data = []): Json
|
|
|
{
|
|
|
- $db = OrderModel::alias('a')
|
|
|
- ->leftJoin('good b', 'b.id=a.good_id AND b.is_del=' . CommonModel::$del_normal)
|
|
|
- ->where(['a.is_del'=>CommonModel::$del_normal, 'a.uid' => self::$aid]);
|
|
|
+ $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.good_name,a.num,a.status,a.addtime,a.type,a.price,a.total_price')
|
|
|
+ ->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]);
|
|
|
+ return json_show(CommonModel::$success, '获取服务订单列表成功', ['count' => $count, 'list' => $list]);
|
|
|
|
|
|
}
|
|
|
|
|
|
//订单详情
|
|
|
- public static function info(int $id = 0): Json
|
|
|
+ public static function orderInfo(int $id = 0): Json
|
|
|
{
|
|
|
- $rs = OrderModel::alias('a')
|
|
|
- ->field('a.id,a.orderCode,a.status,a.addtime,a.type,b.good_name,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('good b', 'b.id=a.good_id AND b.is_del=' . CommonModel::$del_normal)
|
|
|
+ $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])
|
|
@@ -85,12 +86,9 @@ class ServiceLogic extends BaseLogic
|
|
|
->findOrEmpty()
|
|
|
->toArray();
|
|
|
|
|
|
- return $rs ? json_show(CommonModel::$success, '获取订单详情成功', $rs) : json_show(CommonModel::$error_param, '该订单不存在');
|
|
|
+ return $rs ? json_show(CommonModel::$success, '获取服务订单详情成功', $rs) : json_show(CommonModel::$error_param, '该服务订单不存在');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|