OrderController.php
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Powerless < wzxaini9@gmail.com>
// +----------------------------------------------------------------------
namespace app\user\controller;
use app\user\model\CommentModel;
use cmf\controller\UserBaseController;
use app\user\model\UserModel;
use think\Db;
use think\Request;
class OrderController extends UserBaseController
{
//我的订单
public function my_order()
{
$uid = session('user.id');
$data = Db::name('order')
->alias('o')
->join('__GOODS__ g','o.gid = g.id')
->join('__USER__ u','u.id = o.uid')
->where(['uid'=>session('user.id'),'o.status'=>'1'])
->field('o.*,g.name,g.price')
->select()
->toArray();
$this->assign('data',$data);
return $this->fetch();
}
//订单详情
public function order_details(Request $req){
$id = $req->param('id');
$data = Db::name('order')
->alias('o')
->join('__USER__ u','o.uid = u.id')
->where(['o.id'=>$id])
->field('o.*,u.*')
->find();
$this->assign('data',$data);
return $this->fetch();
}
//订单详情11
public function order_details_1(Request $req){
$id = $req->param('id');
$data = Db::name('order')
->alias('o')
->join('__GOODS__ g','o.gid = g.id')
->where(['o.id'=>$id])
->field('g.*')
->find();
$this->assign('data',$data);
return $this->fetch();
}
//支付成功
public function pay_success(){
return $this->fetch();
}
}