diff --git a/admin/controllers/app/bobing/Member.php b/admin/controllers/app/bobing/Member.php index 14377acf..d6842395 100644 --- a/admin/controllers/app/bobing/Member.php +++ b/admin/controllers/app/bobing/Member.php @@ -6,6 +6,7 @@ class Member extends HD_Controller { private $where, $appConfig; private $wxqyAry = array(0 => '未加', 1 => '加入', -1 => '删除'); + private $ifkzAry = array(0 => '未开', 1 => '已开'); private $levelNameAry = array(13 => "状元插金花", 12 => "六勃红", 11 => "遍地锦", 10 => "六抔黑", 9 => "五红", 8 => "五子带一秀", 7 => "五子", 6 => "状元", 5 => "对堂", 4 => "三红", 3 => "四进", 2 => "二举", 1 => "一秀", 0 => "罚黑"); @@ -29,6 +30,30 @@ class Member extends HD_Controller //数据列表 public function lists() { + $menuAry = array(array('id' => 1, 'title' => "红包发放总金额", 'value' => 0, 'tag' => '元') + , array('id' => 2, 'title' => "今天红包发放金额", 'value' => 0, 'tag' => '元') + , array('id' => 3, 'title' => "购车金发放总金额", 'value' => 0, 'tag' => '元') + , array('id' => 4, 'title' => "今天购车金发放金额", 'value' => 0, 'tag' => '元')); + $date = date('Y-m-d'); + foreach ($menuAry as $key => $value) { + $sum = 0; + if ($value['id'] == 1) { + $hong_bao_day = $this->mdBobingLogs->sum('hong_bao', array_merge($this->where, array('status' => 2))); + $sum = $hong_bao_day['hong_bao']; + } else if ($value['id'] == 2) { + $hong_bao_day = $this->mdBobingLogs->sum('hong_bao', array_merge($this->where, array('bo_date' => $date, 'status' => 2))); + $sum = $hong_bao_day['hong_bao']; + } else if ($value['id'] == 3) { + $car_gold = $this->mdBobingUser->sum('car_gold', $this->where); + $buy_car_gold = $this->mdBobingUser->sum('buy_car_gold', $this->where); + $lotter_gold = $this->mdBobingUser->sum('lotter_gold', $this->where); + $sum = $car_gold['car_gold'] + $buy_car_gold['buy_car_gold'] + $lotter_gold['lotter_gold']; + } else if ($value['id'] == 4) { + $car_gold = $this->mdBobingLogs->sum('car_gold', array_merge($this->where, array('bo_date' => $date))); + $sum = $car_gold['car_gold']; + } + $menuAry[$key]['value'] = $sum ? $sum : 0; + } $params = $this->input->get(); $params['page'] = $params['page'] ? intval($params['page']) : 1; $params['size'] = $params['size'] ? intval($params['size']) : 20; @@ -46,6 +71,16 @@ class Member extends HD_Controller !$uids && $uids[] = 0; $where['uid in (' . implode(',', $uids) . ')'] = null; } + if (status_verify($params['wxqy'])) { + $where['wxqy'] = $params['wxqy']; + } else { + $params['wxqy'] = -99; + } + if (status_verify($params['if_kz'])) { + $where['if_kz'] = $params['if_kz']; + } else { + $params['if_kz'] = -99; + } $count = $this->mdBobingUser->count(array_merge($this->where, $where)); if ($count) { $res = $this->mdBobingUser->select(array_merge($this->where, $where), 'id desc', $params['page'], $params['size']); @@ -65,13 +100,16 @@ class Member extends HD_Controller $car_gold = $value['car_gold'] . '+' . $value['buy_car_gold'] . '+' . $value['lotter_gold'] . '=' . $car_gold . ''; $setValue['car_gold'] = $car_gold; - $setValue['if_kz'] = $value['if_kz'] == 1 ? '已开' : '未开'; + $setValue['if_kz'] = $this->ifkzAry[$value['if_kz']]; $setValue['wxqy'] = $this->wxqyAry[$value['wxqy']]; $lists[] = $setValue; } } $this->data['lists'] = $lists; $this->data['params'] = $params; + $this->data['menuAry'] = $menuAry; + $this->data['wxqyAry'] = $this->wxqyAry; + $this->data['ifkzAry'] = $this->ifkzAry; $this->data['_title'] = '博饼用户'; $this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count); return $this->show_view('/app/bobing/member/lists', true); @@ -153,7 +191,7 @@ class Member extends HD_Controller $this->data['params'] = $params; $this->data['_title'] = $nickname . '_每日博饼'; $this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count); - return $this->show_view('/app/bobing/member/lists_logs', true); + return $this->show_view('/app/bobing/member/lists_day', true); } //展示单条数据 diff --git a/admin/controllers/app/liche/Main.php b/admin/controllers/app/liche/Main.php index ec40436b..4b9c28f8 100644 --- a/admin/controllers/app/liche/Main.php +++ b/admin/controllers/app/liche/Main.php @@ -18,6 +18,7 @@ class Main extends HD_Controller $this->load->model('app/liche/App_liche_users_model', 'userM'); $this->load->model('topics/topics_model', 'mdTopics'); $this->load->model('Subjects_model', 'subM'); + $this->load->model('bobing/bobing_user_model', 'mdBobingUser'); } public function index() @@ -63,8 +64,11 @@ class Main extends HD_Controller ), ); + $appConfig = $this->mdBobingUser->appConfig(); + $value = $this->mdBobingUser->count(array('act_key' => $appConfig['act_key'], 'app_id' => $appConfig['app_id'])); $list[] = array( - 'title' => '博饼', + 'title' => '博饼(人)', + 'value' => $value, 'btns' => array( array('name' => '查看详情', 'url' => '/app/bobing/member?app_id=' . $this->app_id), ), @@ -74,12 +78,12 @@ class Main extends HD_Controller /*小程序设置 end*/ $list = []; - $value = $this->userM->count(['dealer'=>1,'up_uid'=>0]); + $value = $this->userM->count(['dealer' => 1, 'up_uid' => 0]); $list[] = array( 'title' => '分销用户(人)', 'value' => $value, 'btns' => array( - array('name' => '查看详情', 'url' => '/appdistribution/distribution?app_id='.$this->app_id), + array('name' => '查看详情', 'url' => '/appdistribution/distribution?app_id=' . $this->app_id), ), ); diff --git a/admin/views/app/bobing/member/lists.php b/admin/views/app/bobing/member/lists.php index f97c553e..2bceefe2 100644 --- a/admin/views/app/bobing/member/lists.php +++ b/admin/views/app/bobing/member/lists.php @@ -1,3 +1,21 @@ +
| 骰子点数 | -级别 | -积分 | -购车金 | -红包 | -类型 | 博饼日期 | +积分 | +是否中奖 |
|---|---|---|---|---|---|---|---|---|
| = $v['dices'] ?> | -= $v['level_name'] ?> | -= $v['credit'] ?> | -= $v['car_gold'] ?> | -= $v['hong_bao'] ?> | -= $v['type_name'] ?> | = $v['bo_date'] ?> | += $v['credit'] ?> | += $v['lottery'] ?> |