bobing_909_5
This commit is contained in:
@@ -141,28 +141,11 @@ class Member extends HD_Controller
|
||||
$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;
|
||||
$setValue['credit'] = $value['credit'];
|
||||
$setValue['lottery'] = $value['lottery'] == 1 ? '中奖' : '未中奖';
|
||||
$lists[] = $setValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ class Bobing extends HD_Controller
|
||||
$this->log_file = 'bobing.log';
|
||||
$this->load->model('bobing/bobing_user_model', 'mdBobingUser');
|
||||
$this->load->model('bobing/bobing_user_credit_model', 'mdBobingUserCredit');
|
||||
$this->load->model('bobing/bobing_logs_model', 'mdBobingLogs');
|
||||
$this->appConfig = $this->mdBobingUser->appConfig();
|
||||
}
|
||||
|
||||
@@ -85,6 +86,14 @@ class Bobing extends HD_Controller
|
||||
*/
|
||||
public function mj()
|
||||
{
|
||||
$params = $this->input->get();
|
||||
if ($params['sd']) {
|
||||
$date = date('Y-m-d');
|
||||
$hong_bao_day = $this->mdBobingLogs->sum('hong_bao', array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']
|
||||
, 'bo_date' => $date, 'status' => 2));
|
||||
echo $date . '_发放红包' . $hong_bao_day['hong_bao'] . '元';
|
||||
return;
|
||||
}
|
||||
$hour = date('H');
|
||||
if ($hour < 9 || $hour > 22) {
|
||||
echo '9点到22点博';
|
||||
|
||||
@@ -140,8 +140,9 @@ class Bo extends Base
|
||||
, 'url' => '/bobing/pages/index/index'));
|
||||
}
|
||||
}
|
||||
$hong_bao_day = $this->ci->bobing_user_model->hongBaoDay($data['act_key']);
|
||||
if ($hong_bao_day < $this->appConfig['max_hong_bao_day']) {//无购车金时抽红包与红包小于每日设定值
|
||||
$hong_bao_day = $this->ci->bobing_logs_model->sum('hong_bao', array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']
|
||||
, 'bo_date' => date('Y-m-d'), 'status' => 2));
|
||||
if ($hong_bao_day['hong_bao'] < $this->appConfig['max_hong_bao_day']) {//无购车金时抽红包与红包小于每日设定值
|
||||
if ($this->appConfig['ratio_hong_bao'] && $this->appConfig['ratio_hong_bao'] <= rand(1, 100)) {//红包概率
|
||||
$hb_count = $this->ci->bobing_logs_model->count(array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $data['uid']
|
||||
, 'cf_uid' => $data['cf_uid'], 'hong_bao >' => 0));
|
||||
|
||||
Reference in New Issue
Block a user