CenterController.class.php
2.3 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
<?php
namespace User\Controller;
use Common\Controller\MemberbaseController;
class CenterController extends MemberbaseController {
function _initialize(){
parent::_initialize();
}
// 会员中心首页
public function index() {
// 查询用户订单各状态总数(1,未付款;3,已发货;5,已完成;6,已取消) 手机端用
$this->orderCount();
// 获取报名总数 手机端用
$count['sign'] = M('Order')->field(array('id,user_id,sheet,sheet_id,status,price_count,ctime'))->where(array('user_id'=>$this->userid,'sort'=>2))->count();
// 获取投稿总数 手机端用
// 青年文创
$chance = M('ChanceApply')->where(array('user_id'=>$this->userid,'is_del'=>0))->count();
// 恋物故事
$story = M('StoryApply')->where(array('user_id'=>$this->userid,'is_del'=>0))->count();
// 双创项目
$willProduce = M('WillProduceApply')->where(array('user_id'=>$this->userid,'is_del'=>0))->count();
$count['willProduce'] = $willProduce;
$count['contribute'] = $chance + $story + $willProduce;
// 入会申请
$count['willUser'] = M('WillUserApply')->where(array('user_id'=>$this->userid,'is_del'=>0))->count();
// 任务发布
$count['willMission'] = M('WillMissionApply')->where(array('user_id'=>$this->userid,'is_del'=>0))->count();
// 近期活动
$count['willEvents'] = M('WillEventsApply')->where(array('user_id'=>$this->userid))->count();
// 获取站内信总数
$message_model = D('Common/Message');
$count['message'] = $message_model->getCount($this->userid);
$this->assign('count',$count);
// 调用置顶的3个商品
$goods_model = D('Common/Goods');
$top = $goods_model->where(array('istop'=>1,'is_del'=>0))->order(array('ctime'=>'DESC'))->limit(4)->select();
$this->assign('top',$top);
$this->display(':center');
}
// 入会申请
public function will() {
$will_user_apply_model = D('Common/WillUserApply');
$info = $will_user_apply_model->getInfo($this->userid);
$this->assign($info);
$this->display(':will');
}
// 退换货页面
public function returns() {
$this->assign('policy','active');
$this->display(':return');
}
}