UserController.php 2.1 KB
<?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();
    }

}