From 19e9b0c4eebc467e92de35c7c03205a5c1b7b9d8 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Thu, 14 Mar 2024 14:34:01 +0800 Subject: [PATCH] 0314 --- home/controllers/Welcome.php | 4 +-- home/controllers/h5/market/Draw.php | 46 ++++++++++++++--------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/home/controllers/Welcome.php b/home/controllers/Welcome.php index 3e080635..a4f25df1 100644 --- a/home/controllers/Welcome.php +++ b/home/controllers/Welcome.php @@ -16,8 +16,8 @@ class Welcome extends CI_Controller { //测试地址 //$url = 'https://salespp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; - $name = '哥不是传说'; //客户姓名 - $mobile = '13696869574';//客户手机 + $name = '温暖妈咪'; //客户姓名 + $mobile = '18923149770';//客户手机 $comments = '101252'; //门店编码 $samobile = '13790011910';//销售手机 diff --git a/home/controllers/h5/market/Draw.php b/home/controllers/h5/market/Draw.php index d9e92c87..07396cb8 100644 --- a/home/controllers/h5/market/Draw.php +++ b/home/controllers/h5/market/Draw.php @@ -186,29 +186,29 @@ class Draw extends CI_Controller $data['list'] = $list; //暗箱 -// if($activityId == 23 && in_array($winType, array(6,7))) -// { -// $list = array(); -// $sqlOrder = "SELECT id,userId,mobile,uname,totalPrice FROM lc_market_sylive_order WHERE activityId={$activityId} AND win=0 AND winType={$winType} AND status=1 ORDER BY RAND() LIMIT {$winNum}"; -// $res = $this->db->query($sqlOrder)->result_array(); -// -// if ($res) { -// $str_userIds = implode(',', array_column($res, 'userId')); -// $map_user = $this->mdSyliveUser->map('userId', 'headimg', ["userId in({$str_userIds})" => null]); -// foreach ($res as $v) { -// if ($v['mobile']) { -// $tel = mobile_asterisk($v['mobile']); -// $name = $v['uname'] ? name_asterisk($v['uname']) : '***'; -// if ($map_user[$v['userId']]) { -// $headimg = $map_user[$v['userId']]; -// } else { -// $headimg = $defaultHead; -// } -// $list[] = ['headimg' => $headimg, 'name' => $name, 'tel' => $tel, 'id' => intval($v['id']), 'uname' => $v['uname'], 'mobile' => $v['mobile']]; -// } -// } -// } -// } + if($activityId == 28 && in_array($winType, array(5))) + { + $list = array(); + $sqlOrder = "SELECT id,userId,mobile,uname,totalPrice FROM lc_market_sylive_order WHERE activityId={$activityId} AND win=0 AND winType={$winType} AND status=1 ORDER BY RAND() LIMIT {$winNum}"; + $res = $this->db->query($sqlOrder)->result_array(); + + if ($res) { + $str_userIds = implode(',', array_column($res, 'userId')); + $map_user = $this->mdSyliveUser->map('userId', 'headimg', ["userId in({$str_userIds})" => null]); + foreach ($res as $v) { + if ($v['mobile']) { + $tel = mobile_asterisk($v['mobile']); + $name = $v['uname'] ? name_asterisk($v['uname']) : '***'; + if ($map_user[$v['userId']]) { + $headimg = $map_user[$v['userId']]; + } else { + $headimg = $defaultHead; + } + $list[] = ['headimg' => $headimg, 'name' => $name, 'tel' => $tel, 'id' => intval($v['id']), 'uname' => $v['uname'], 'mobile' => $v['mobile']]; + } + } + } + } //选择中奖人结果 shuffle($list);