From b1f26f9f9928665de9e892ab1eb4f01e3ed76c07 Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 9 Sep 2021 17:02:43 +0800 Subject: [PATCH] bobing_909_4 --- admin/controllers/app/bobing/Member.php | 75 +++++++++++++++--- admin/views/app/bobing/member/lists.php | 10 +-- admin/views/app/bobing/member/lists_day.php | 88 +++++++++++++++++++++ api/controllers/plan/Bobing.php | 3 +- api/controllers/wxapp/bobing/Bobing.php | 2 +- 5 files changed, 161 insertions(+), 17 deletions(-) create mode 100644 admin/views/app/bobing/member/lists_day.php 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 @@
- +
- +
@@ -27,7 +27,7 @@ 用户名称 手机号码 积分 - 购车金 + 博饼+企微+排名=总购车金 开桌 企业微信 @@ -46,12 +46,12 @@ diff --git a/admin/views/app/bobing/member/lists_day.php b/admin/views/app/bobing/member/lists_day.php new file mode 100644 index 00000000..7910b049 --- /dev/null +++ b/admin/views/app/bobing/member/lists_day.php @@ -0,0 +1,88 @@ +
+ +
+
共有条数据
+ + + + + + + + + + + + + + + + + + + + + + + + + +
骰子点数级别积分购车金红包类型博饼日期
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/api/controllers/plan/Bobing.php b/api/controllers/plan/Bobing.php index ee2fc987..58cd68aa 100644 --- a/api/controllers/plan/Bobing.php +++ b/api/controllers/plan/Bobing.php @@ -99,7 +99,8 @@ class Bobing extends HD_Controller return; } $uid = 5; - $credit = rand(50, 120); + $credits = array(1 => 30, 2 => 50, 3 => 60, 4 => 70, 5 => 80, 6 => 90, 7 => 100, 8 => 120); + $credit = $credits[rand(1, 8)]; $where = array('uid' => $uid, 'app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']); $ret = $this->mdBobingUser->update(array("credit = credit+{$credit}" => null), $where); if ($ret) { diff --git a/api/controllers/wxapp/bobing/Bobing.php b/api/controllers/wxapp/bobing/Bobing.php index 07c77a06..86e7f234 100644 --- a/api/controllers/wxapp/bobing/Bobing.php +++ b/api/controllers/wxapp/bobing/Bobing.php @@ -131,7 +131,7 @@ class Bobing extends Wxapp $data['status'] = $status; $valid_nums['value'] = $this->bo->valid_nums <= 0 ? 0 : $this->bo->valid_nums - 1; $data['dices'] = $result['dices']; - $data['level'] = $result['level']; + $data['level'] = $result['level'] > 6 ? 6 : $result['level']; $data['bo_title'] = $result['level_name'] . ' + ' . $result['credit']; $data['valid_nums'] = $valid_nums; $data['top_title'] = $this->get_top_title($cf_uid);