edit-sylive-plan
This commit is contained in:
@@ -44,18 +44,19 @@ class Syt extends CI_Controller
|
||||
$date = date('Y-m-d H:i:s', strtotime('+10 minute'));//提前10分钟发送
|
||||
$where['timeStart<='] = $date;
|
||||
$where['status'] = 0;
|
||||
$min_row = $this->mdSytSubscribemsg->get($where,'min(id) as id');
|
||||
$max_row = $this->mdSytSubscribemsg->get($where,'max(id) as id');
|
||||
// if(($max_row['id']-$min_row['id'])>1000){
|
||||
// $ids_arr = [];
|
||||
// for($i=0;$i<$size;$i++){
|
||||
// $s_id = rand($min_row['id'],$max_row['id']);
|
||||
// $s_id += 1;
|
||||
// $ids_arr[] = $s_id;
|
||||
// }
|
||||
// $ids = implode(',',array_unique($ids_arr));
|
||||
// $ids && $where["id in ({$ids})"] = null;
|
||||
// }
|
||||
$count = $this->mdSytSubscribemsg->count($where);
|
||||
if($count>1000){
|
||||
$min_row = $this->mdSytSubscribemsg->get($where,'min(id) as id');
|
||||
$max_row = $this->mdSytSubscribemsg->get($where,'max(id) as id');
|
||||
$ids_arr = [];
|
||||
for($i=0;$i<$size;$i++){
|
||||
$s_id = rand($min_row['id'],$max_row['id']);
|
||||
$s_id += 1;
|
||||
$ids_arr[] = $s_id;
|
||||
}
|
||||
$ids = implode(',',array_unique($ids_arr));
|
||||
$ids && $where["id in ({$ids})"] = null;
|
||||
}
|
||||
$res = $this->mdSytSubscribemsg->select($where, 'id asc', 1, $size);
|
||||
$log = array();
|
||||
if ($res) {
|
||||
@@ -274,6 +275,7 @@ class Syt extends CI_Controller
|
||||
public function out_time(){
|
||||
$this->load->model('market/market_sylive_activity_orders_model','mdSytActivityOrders');
|
||||
$this->load->model('market/market_sylive_order_model');
|
||||
$this->load->model('market/market_sylive_items_model');
|
||||
//商家订单过期
|
||||
$where = [
|
||||
'expireTime>' => 0,
|
||||
@@ -295,7 +297,7 @@ class Syt extends CI_Controller
|
||||
$up_data = [
|
||||
'stock = stock+1' => null
|
||||
];
|
||||
$this->market_sylive_activity_model->update($up_data,['activityId'=>$val['itemId']]);
|
||||
$this->market_sylive_items_model->update($up_data,['itemId'=>$val['itemId']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,34 +339,13 @@ class Syt extends CI_Controller
|
||||
$user = $this->user_model->get(['unionid'=>$value['param1']]);
|
||||
$user && $ac_user = $this->act_user_model->get(['activityId'=>$value['activityId'],'userId'=>$user['userId']]);
|
||||
if($ac_user['channelId']){
|
||||
$ac_user['channelId'] && $p_user = $this->user_model->get(['userId'=>$ac_user['channelId']]);
|
||||
if(!$p_user){
|
||||
if($ac_user['teamId']){
|
||||
$t_level_id = $this->sylive_entity->get_team_level($ac_user['teamId']);
|
||||
$p_user = $t_level_id<3 ? $user : 0;
|
||||
}
|
||||
if($ac_user['organizationId']){
|
||||
$group_id = $this->sylive_entity->get_level($ac_user['organizationId']);
|
||||
$p_user = $group_id<4 ? $p_user : 0;
|
||||
}
|
||||
}
|
||||
$ac_user['channelId'] && $p_user = $this->act_user_model->get(['activityId'=>$value['activityId'],'userId'=>$ac_user['channelId']]);
|
||||
$p_user['cfUserId'] && $addData['cfUserId'] = $p_user['userId'];
|
||||
$p_user['bizId'] && $addData['bizId'] = $p_user['bizId'];
|
||||
$p_user['levelId1'] && $addData['levelId1'] = $p_user['levelId1'];
|
||||
$p_user['levelId2'] && $addData['levelId2'] = $p_user['levelId2'];
|
||||
$p_user['levelId3'] && $addData['levelId3'] = $p_user['levelId3'];
|
||||
}
|
||||
if($p_user['teamId']){
|
||||
$addData['type'] = 1;
|
||||
$team_lists = $this->sylive_entity->get_team_lists($p_user['teamId']);
|
||||
$area_id = $team_lists[0]['teamId']; //大团长id
|
||||
$biz_id = $team_lists[1]['teamId']; //团长id
|
||||
$addData['cfUserId'] = $p_user['userId'];
|
||||
}
|
||||
if($p_user['organizationId']){
|
||||
$addData['type'] = 0;
|
||||
$team_lists = $this->sylive_entity->get_level_lists($p_user['organizationId']);
|
||||
$area_id = $team_lists[1]['organizationId']; //获取大区id
|
||||
$biz_id = $team_lists[2]['organizationId']; //获取店铺id
|
||||
$addData['cfUserId'] = $p_user['userId'];
|
||||
}
|
||||
$area_id && $addData['areaId'] = $area_id;
|
||||
$biz_id && $addData['bizId'] = $biz_id;
|
||||
$user && $addData['userId'] = $user['userId'];
|
||||
$this->market_sylive_viewlog_model->add($addData);
|
||||
}
|
||||
|
||||
@@ -218,6 +218,9 @@ class Wx extends Common{
|
||||
if(!in_array($method,$this->white_login_method) && !$this->uid){
|
||||
$ret = $this->set_auth();
|
||||
$openid = $ret['openid'];
|
||||
if(!$openid){
|
||||
echo ("<script>setTimeout('window.location.reload()', 1);</script>");exit;
|
||||
}
|
||||
$skey = $this->input->get('skey');
|
||||
$param = $this->myencryption->base64url_decode($skey);
|
||||
//找管理员角色
|
||||
|
||||
Reference in New Issue
Block a user