diff --git a/admin/controllers/app/bobing/Member.php b/admin/controllers/app/bobing/Member.php index 222bb3e7..098b5875 100644 --- a/admin/controllers/app/bobing/Member.php +++ b/admin/controllers/app/bobing/Member.php @@ -32,10 +32,23 @@ class Member extends HD_Controller $params = $this->input->get(); $params['page'] = $params['page'] ? intval($params['page']) : 1; $params['size'] = $params['size'] ? intval($params['size']) : 20; - $lists = $users = array(); - $count = $this->mdBobingUser->count($this->where); + $lists = $users = $where = array(); + if ($params['name'] || $params['mobile']) { + $where_u = array(); + if ($params['name']) { + $where_u = array("nickname LIKE '%{$params['name']}%'" => null); + } + if ($params['mobile']) { + $where_u = array("mobile LIKE '%{$params['mobile']}%'" => null); + } + $res_u = $this->user_service->select($where_u, 'id DESC', 0, 0, 'id'); + $uids = array_column($res_u, 'id'); + !$uids && $uids[] = 0; + $where['uid in (' . implode(',', $uids) . ')'] = null; + } + $count = $this->mdBobingUser->count(array_merge($this->where, $where)); if ($count) { - $res = $this->mdBobingUser->select($this->where, 'id desc', $params['page'], $params['size']); + $res = $this->mdBobingUser->select(array_merge($this->where, $where), 'id desc', $params['page'], $params['size']); $uids = array_column($res, 'uid'); $res_u = $this->user_service->select(array('id in (' . implode(',', $uids) . ')' => null), 'id DESC', 0, 0, 'id,nickname,mobile'); foreach ($res_u as $key => $value) { @@ -43,24 +56,22 @@ class Member extends HD_Controller } foreach ($res as $key => $value) { $setValue = array(); - $re_uc = $this->mdBobingUserCredit->select(array_merge($this->where, array('uid' => $value['uid'], 'lottery>' => 0)), 'lottery DESC', 0, 0, 'lottery'); - $lotteryry = array(); - foreach ($re_uc as $key1 => $value2) { - $lotteryry[] = $this->mdBobingUser->lottery($value2['lottery']); - } - $setValue['lottery'] = $lotteryry ? '已中奖' . implode(',', $lotteryry) . '' : ''; $user = $users[$value['uid']]; $setValue['uid'] = $value['uid']; $setValue['nickname'] = $user['nickname']; $setValue['mobile'] = $user['mobile']; $setValue['credit'] = $value['credit']; - $setValue['car_gold'] = $value['car_gold'] + $value['buy_car_gold']; + $car_gold = $value['car_gold'] + $value['buy_car_gold'] + $value['lotter_gold']; + $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['wxqy'] = $this->wxqyAry[$value['wxqy']]; $lists[] = $setValue; } } $this->data['lists'] = $lists; + $this->data['params'] = $params; $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); @@ -117,6 +128,50 @@ class Member extends HD_Controller return $this->show_view('/app/bobing/member/lists_logs', true); } + public function lists_day() + { + $params = $this->input->get(); + $params['page'] = $params['page'] ? intval($params['page']) : 1; + $params['size'] = $params['size'] ? intval($params['size']) : 20; + $uid = intval($params['uid']); + $res_u = $this->user_service->get(array('id' => $uid)); + $nickname = $res_u['nickname'] ? $res_u['nickname'] : '未授权'; + $lists = $users = array(); + $where = array('uid' => $uid); + $count = $this->mdBobingUserCredit->count(array_merge($this->where, $where)); + if ($count) { + $res = $this->mdBobingUserCredit->select(array_merge($this->where, $where), 'id desc', $params['page'], $params['size']); + $cfusers = array();//微信昵称 + $cf_uids = array_unique(array_column($res, 'cf_uid')); + $re_u = $this->user_service->select(array('id in (' . implode(',', $cf_uids) . ')' => null), 'id DESC', 0, 0, 'id,nickname'); + foreach ($re_u as $key => $value) { + $cfusers[$value['id']] = $value['nickname'] ? $value['nickname'] : '未授权'; + } + foreach ($res as $key => $value) { + $setValue = array(); + $setValue['dices'] = $value['dices']; + $setValue['level_name'] = $value['type'] != 2 ? $this->levelNameAry[$value['level']] : ''; + $setValue['credit'] = $value['credit']; + $setValue['car_gold'] = $value['car_gold'] > 0 ? $value['car_gold'] : ''; + $setValue['hong_bao'] = $value['hong_bao'] > 0 ? $value['hong_bao'] . ($value['status'] == 2 ? '已领' : '未领') : ''; + $setValue['bo_date'] = $value['bo_date']; + if ($value['type'] == 1) { + $type_name = $cfusers[$value['cf_uid']] . '帮博'; + } else if ($value['type'] == 2) { + $type_name = '加企微'; + } else { + $type_name = '个人博'; + } + $setValue['type_name'] = $type_name; + $lists[] = $setValue; + } + } + $this->data['lists'] = $lists; + $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); + } //展示单条数据 public function get() diff --git a/admin/views/app/bobing/member/lists.php b/admin/views/app/bobing/member/lists.php index 6938cfed..f97c553e 100644 --- a/admin/views/app/bobing/member/lists.php +++ b/admin/views/app/bobing/member/lists.php @@ -5,13 +5,13 @@
| 骰子点数 | +级别 | +积分 | +购车金 | +红包 | +类型 | +博饼日期 | +
|---|---|---|---|---|---|---|
| = $v['dices'] ?> | += $v['level_name'] ?> | += $v['credit'] ?> | += $v['car_gold'] ?> | += $v['hong_bao'] ?> | += $v['type_name'] ?> | += $v['bo_date'] ?> | +