...
|
...
|
@@ -201,16 +201,62 @@ class CenterController extends HomeBaseController |
|
|
public function orderDetail()
|
|
|
{
|
|
|
$request = request();
|
|
|
//订单基本信息
|
|
|
$oid = $request->param('oid');
|
|
|
$info = Db::name('order_info')->alias('o')
|
|
|
->field('o.id as oid,o.order_sn,a.name,a.thumb,o.status')
|
|
|
->field('o.id as oid,o.order_sn,a.name,a.thumb,o.status,a.down_price,s.price')
|
|
|
->join('activity a', 'a.id=o.activity_id')
|
|
|
->join('activity_schedule s', 's.id=o.schedule_id')
|
|
|
->where(['o.id' => $oid])
|
|
|
->order('add_time DESC')
|
|
|
->find();
|
|
|
$info['status_text'] = getOrderStatusText($info['status']);
|
|
|
$info['count'] = Db::name('order_detail')->where(['oid' => $oid])->count();
|
|
|
echo json_encode(['data' => $info, 'code' => 20000]);
|
|
|
$escort = Db::name('order_detail')->alias('d')
|
|
|
->field('d.id,d.status,e.name,e.tel')
|
|
|
->join('escort e', 'e.id=d.escort_id')
|
|
|
->where(['oid' => $oid])
|
|
|
->select();
|
|
|
foreach ($escort as $k => $v) {
|
|
|
$v['count'] = 1;
|
|
|
$v['down_price'] = $info['down_price'];
|
|
|
$escort[$k] = $v;
|
|
|
}
|
|
|
$return = [
|
|
|
'baseInfo' => $info,
|
|
|
'escort' => $escort
|
|
|
];
|
|
|
echo json_encode(['data' => $return, 'code' => 20000]);
|
|
|
exit();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 钱包记录
|
|
|
* @description 默认访问接口
|
|
|
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
|
|
|
* @url /user/Center/walletLog
|
|
|
* @method POST
|
|
|
*/
|
|
|
public function walletLog()
|
|
|
{
|
|
|
$balance = Db::name('user')->where(['id' => session('user.id')])->value('balance');
|
|
|
$log = Db::name('my_wallet')->field('type,cost,create_time')->where(['user_id' => session('user.id')])->order('create_time DESC')->select()->toArray();
|
|
|
foreach ($log as $k => $v) {
|
|
|
$v['create_time'] = date('Y.m.d H:i:s', $v['create_time']);
|
|
|
if ($v['type'] == 0) {
|
|
|
$v['type_text'] = '账户消费';
|
|
|
} elseif ($v['type'] == 1) {
|
|
|
$v['type_text'] = '账户充值';
|
|
|
} else {
|
|
|
$v['type_text'] = '退款订单';
|
|
|
}
|
|
|
$log[$k] = $v;
|
|
|
}
|
|
|
$return = [
|
|
|
'balance' => $balance,
|
|
|
'log' => $log
|
|
|
];
|
|
|
echo json_encode(['data' => $return, 'code' => 20000]);
|
|
|
exit();
|
|
|
}
|
|
|
|
...
|
...
|
|