|
@@ -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, '该服务订单不存在');
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
}
|