AdminGetController.php
3.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
// +----------------------------------------------------------------------
// | bronet [ 以客户为中心 以奋斗者为本 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <bronet@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;
use cmf\controller\AdminBaseController;
use think\Db;
/**
* Class AdminGetController
* @package app\portal\controller
* @adminMenuRoot(
* 'name' =>'提现记录',
* 'action' =>'default',
* 'parent' =>'',
* 'display'=> true,
* 'order' => 30,
* 'icon' =>'th',
* 'remark' =>'提现记录'
* )
*/
class AdminGetController extends AdminBaseController
{
/**
* 提现记录
* @adminMenu(
* 'name' => '提现记录',
* 'parent' => 'portal/AdminGet/default',
* 'display'=> true,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '提现记录',
* 'param' => ''
* )
*/
public function index()
{
$data = $this->request->param();
$return = $this->adminIndex($data);
$page_arr = $return['page_arr'];
if(!empty($return['where_arr']['create_time'])){
$where_vehicle['g.create_time'] = $return['where_arr']['create_time'];
}
if(!empty($data['keyword'])){
$page_arr['keyword'] = $data['keyword'];
$where_vehicle['m.name'] = array('like','%'.$data['keyword'].'%');
$this->assign('keyword', $data['keyword']);
}
$where_vehicle['g.status'] = array('neq',9);
$list = Db::name('GetMoney')->alias('g')
->where($where_vehicle)
->join('Member m','m.id = g.user_id')
->join('Order o','o.id = g.order_id')
->field('g.*,m.name as user_name ,m.id as user_id , o.order_sn')
->order('create_time desc')
->paginate(10,false,['query'=>$page_arr]);
$page = $list->render();
$this->assign('page', $page);
$this->assign('list', $list);
return $this->fetch();
}
/**
* 删除提现记录
* @adminMenu(
* 'name' => '删除提现记录',
* 'parent' => 'index',
* 'display'=> false,
* 'hasView'=> false,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '删除提现记录',
* 'param' => ''
* )
*/
public function delete()
{
$data = $this->request->param();
$where_stock['id'] = $data['id'];
$up['status'] = 9;
$up['update_time'] = time();
$is_candel = Db::name('GetMoney')->where($where_stock)->update($up);
if($is_candel){
$this->success('删除成功');
}else{
$this->error('删除失败');
}
}
}