diff --git a/api/controllers/plan/Syt.php b/api/controllers/plan/Syt.php
index 6cd14c31..0fc2db4c 100644
--- a/api/controllers/plan/Syt.php
+++ b/api/controllers/plan/Syt.php
@@ -38,11 +38,13 @@ class Syt extends CI_Controller
*/
public function subscribemsg()
{
+ $size = $this->input->get('size');
+ !$size && $size = 10;
$this->load->model('market/market_sylive_subscribemsg_model', 'mdSytSubscribemsg');
$date = date('Y-m-d H:i:s', strtotime('+10 minute'));//提前10分钟发送
$where['timeStart<='] = $date;
$where['status'] = 0;
- $res = $this->mdSytSubscribemsg->select($where, 'id asc', 1, 200);
+ $res = $this->mdSytSubscribemsg->select($where, 'id asc', 1, $size);
$log = array();
if ($res) {
$wechatS = new WechatServer($this->options);
@@ -56,7 +58,7 @@ class Syt extends CI_Controller
$act_rows = $this->market_sylive_activity_model->map('activityId','',$where,'',0,0,'activityId,title');
}
foreach ($res as $key => $value) {
- $act = $act_rows['activityId'] ? $act_rows['activityId'][0] : [];
+ $act = $act_rows[$value['activityId']] ? $act_rows[$value['activityId']][0] : [];
if ($act) {
$content = '您预约“' . $act['title'] . '”直播已经开始啦!赶紧进入直播间观看直播领取福利吧~';
$temp_arr = array(
@@ -71,23 +73,25 @@ class Syt extends CI_Controller
);
$re = $wechatS->subscribeTemplateMessage($temp_arr);
if ($re) {//errcode 0(发送成功) 43101(已发送过)
- $this->mdSytSubscribemsg->update(['status' => 1], ['id' => $value['id']]);
if ($re['errcode'] == 0) {
- $log[] = $value['a_id'] . '=' . $value['openid'];
+ $this->mdSytSubscribemsg->update(['status' => 1], ['id' => $value['id']]);
+ $log[] = $value['activityId'] . '=' . $value['openId'];
+ }else{
+ $this->mdSytSubscribemsg->update(['status' => -1], ['id' => $value['id']]);
}
}
}else{
$this->mdSytSubscribemsg->update(['status' => -1], ['id' => $value['id']]);
}
}
+ $log && print_r($log);
+ $total = count($res);
+ $do = count($log);
+ debug_log("[info] " . __FUNCTION__ . "# date:{$date}; total:{$total}; do:{$do};", $this->log_file);
}
echo '
数据库获取:';
echo json_encode($res, JSON_UNESCAPED_UNICODE);
echo '
成功发送:';
- $log && print_r($log);
- $total = count($res);
- $do = count($log);
- debug_log("[info] " . __FUNCTION__ . "# date:{$date}; total:{$total}; do:{$do};", $this->log_file);
}
/**
@@ -474,8 +478,18 @@ class Syt extends CI_Controller
//更新黑名单
public function up_black(){
$ckey = 'SYLIVE_BLACK_MOBLIE_LIST';
+ $file_path = FCPATH.'../home/sylive_blacklist.txt';
$redis = &load_cache('redis');
- $res = $redis->delete($ckey);
- echo "更新成功:{$res}";
+ $redis->delete($ckey);
+ $mobile_list = [];
+ if (file_exists($file_path)) {
+ $content_arr = file($file_path);
+ foreach ($content_arr as $item) {
+ $mobile_list[] = trim($item);
+ }
+ }
+ $redis->save($ckey,$mobile_list,2*24*60*60);
+ echo "更新成功,黑名单列表:".json_encode($mobile_list,JSON_UNESCAPED_UNICODE);
}
+
}
diff --git a/home/controllers/h5/market/sylive/Item.php b/home/controllers/h5/market/sylive/Item.php
index 69ef2522..23627be5 100644
--- a/home/controllers/h5/market/sylive/Item.php
+++ b/home/controllers/h5/market/sylive/Item.php
@@ -230,13 +230,14 @@ class Item extends Wx{
}
$redis = &load_cache('redis');
$key = "sylive_item_code_{$this->uid}_{$mobile}";
- if(!$redis->get($key)){
+ $code = $redis->get($key);
+ if(!$code){
$this->load->helper('string');
$code = random_string('numeric', 4);
$redis->save($key, $code, 60*5);
- $content = "【好店云】您的验证码为: {$code},请勿泄露于他人!";
- b2m_send_sms($mobile,$content);
}
+ $content = "【好店云】您的验证码为: {$code},五分钟之内有效,请勿泄露于他人,!";
+ b2m_send_sms($mobile,$content);
$this->show_json('',200, '验证码已发送');
}
@@ -282,7 +283,7 @@ class Item extends Wx{
$mobile_list[] = trim($item);
}
}
- $redis->save($ckey,$mobile_list,10*60);
+ $redis->save($ckey,$mobile_list,2*24*60*60);
}
if(in_array($mobile,$mobile_list)){
return false;
diff --git a/home/views/h5/market/sylive/item/agreement.php b/home/views/h5/market/sylive/item/agreement.php
index 219ad5b1..21859a82 100644
--- a/home/views/h5/market/sylive/item/agreement.php
+++ b/home/views/h5/market/sylive/item/agreement.php
@@ -5,33 +5,47 @@