UserController.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
<?php
// +----------------------------------------------------------------------
// | bronet [ 以客户为中心 以奋斗者为本 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use EasyWeChat\Foundation\Application;
use think\Db;
use think\Session;
//个人中心
class UserController extends CommentController
{
// 个人中心首页
public function index()
{
return $this->fetch('User/index');
}
// 孝力等级
public function grade()
{
$where_art['type'] = 4;
$where_art['status'] = array('neq',9);
$art = Db::name('Art')->where($where_art)->order('score desc,create_time desc')->find();
$art['content'] = htmlspecialchars_decode($art['content']);
$this->assign('art',$art);
return $this->fetch();
}
// 租赁协议
public function rentGrade()
{
$where_art['type'] = 5;
$where_art['status'] = array('neq',9);
$art = Db::name('Art')->where($where_art)->order('score desc,create_time desc')->find();
$art['content'] = htmlspecialchars_decode($art['content']);
$this->assign('art',$art);
return $this->fetch('User/rent_grade');
}
// 我的积分
public function score()
{
$where_member['id'] = Session::get('uid');
$where_member['status'] = array('neq',9);
$member = Db::name('Member')->where($where_member)->value('all_score');
$this->assign('member',$member);
$where_art['user_id'] = Session::get('uid');
$where_art['status'] = array('neq',9);
$art = Db::name('ScoreLog')->where($where_art)->order('create_time desc')->select()->toArray();
$this->assign('art',$art);
return $this->fetch();
}
}