edit-sylive-appt
This commit is contained in:
@@ -499,36 +499,28 @@ class Syt extends CI_Controller
|
||||
}
|
||||
|
||||
public function tmp(){
|
||||
$this->load->model('market/market_sylive_customer_model');
|
||||
$this->load->model('market/market_sylive_activity_user_model', 'act_user_model');
|
||||
$this->load->model('market/market_sylive_viewlog_model');
|
||||
$page = $this->input->get('page');
|
||||
$size = $this->input->get('size');
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 20;
|
||||
$activityId = 6;
|
||||
$where = [
|
||||
'activityId' => $activityId,
|
||||
'activityId' => 9,
|
||||
];
|
||||
$rows = $this->market_sylive_viewlog_model->select($where,'id desc',$page,$size,'id,userId,updateTime');
|
||||
$rows = $this->market_sylive_customer_model->select($where,'customerId asc',$page,$size);
|
||||
if($rows){
|
||||
$user_ids = implode(',',array_column($rows,'userId'));
|
||||
$user_rows = [];
|
||||
if($user_ids){
|
||||
$where = [
|
||||
"userId in ($user_ids)" => null
|
||||
];
|
||||
$user_rows = $this->act_user_model->map('userId','channelId',$where,0,0,'userId,channelId');
|
||||
}
|
||||
foreach ($rows as $key => $val) {
|
||||
if($user_rows['userId']){
|
||||
$update = [
|
||||
'cfUserId' => $user_rows['userId'],
|
||||
'updateTime' => $val['updateTime']
|
||||
];
|
||||
$this->market_sylive_viewlog_model->update($update,['id'=>$val['id']]);
|
||||
}
|
||||
echo "执行成功:{$val['id']}\n";
|
||||
$p_user = [];
|
||||
$val['cfUserId'] && $p_user = $this->act_user_model->get(['userId'=>$val['cfUserId'],'activityId'=>9]);
|
||||
$update = [];
|
||||
$p_user['bizId'] && $update['bizId'] = $p_user['bizId'];
|
||||
$p_user['levelId1'] && $update['levelId1'] = $p_user['levelId1'];
|
||||
$p_user['levelId2'] && $update['levelId2'] = $p_user['levelId2'];
|
||||
$p_user['levelId3'] && $update['levelId3'] = $p_user['levelId3'];
|
||||
$update && $this->market_sylive_customer_model->update($update,['customerId'=>$val['customerId']]);
|
||||
}
|
||||
echo '执行完毕';
|
||||
}else{
|
||||
echo '执行结束';
|
||||
}
|
||||
|
||||
@@ -538,6 +538,8 @@ class Act extends Wx {
|
||||
$ac_row = $this->market_sylive_activity_model->get(['activityId'=>$a_id],'jsondata');
|
||||
$jsondata = json_decode($ac_row['jsondata'],true);
|
||||
$act_user_row = $this->act_user_model->get(['id'=>$this->act_uid]);
|
||||
$p_user = [];
|
||||
$act_user_row['channelId'] && $p_user = $this->act_user_model->get(['userId'=>$act_user_row['channelId'],'activityId'=>$a_id]);
|
||||
$add_data = [
|
||||
'activityId' => $a_id,
|
||||
'userId' => $this->uid,
|
||||
@@ -546,17 +548,15 @@ class Act extends Wx {
|
||||
'createTime' => date('Y-m-d H:i:s')
|
||||
];
|
||||
$act_user_row['channelId'] && $add_data['cfUserId'] = $act_user_row['channelId'];
|
||||
$act_user_row['bizId'] && $add_data['bizId'] = $act_user_row['bizId'];
|
||||
$act_user_row['levelId1'] && $add_data['levelId1'] = $act_user_row['levelId1'];
|
||||
$act_user_row['levelId2'] && $add_data['levelId2'] = $act_user_row['levelId2'];
|
||||
$act_user_row['levelId3'] && $add_data['levelId3'] = $act_user_row['levelId3'];
|
||||
$p_user['bizId'] && $add_data['bizId'] = $p_user['bizId'];
|
||||
$p_user['levelId1'] && $add_data['levelId1'] = $p_user['levelId1'];
|
||||
$p_user['levelId2'] && $add_data['levelId2'] = $p_user['levelId2'];
|
||||
$p_user['levelId3'] && $add_data['levelId3'] = $p_user['levelId3'];
|
||||
$add_data['cfUserId'] && $add_data['status'] = 1;
|
||||
$this->market_sylive_customer_model->add($add_data);
|
||||
if($jsondata['signBespeak']['status'] && $jsondata['signBespeak']['itemId']){ //绑定新增商品订单
|
||||
$itemId = $jsondata['signBespeak']['itemId'];
|
||||
$item = $this->market_sylive_items_model->get(['itemId'=>$itemId]);
|
||||
$p_user = [];
|
||||
$act_user_row['channelId'] && $p_user = $this->act_user_model->get(['userId'=>$act_user_row['channelId'],'activityId'=>$a_id]);
|
||||
$this->load->helper('order');
|
||||
$unpay = [
|
||||
'sid' => create_order_no('350200','market'),
|
||||
@@ -577,7 +577,16 @@ class Act extends Wx {
|
||||
$p_user['levelId2'] && $unpay['levelId2'] = $p_user['levelId2'];
|
||||
$p_user['levelId3'] && $unpay['levelId3'] = $p_user['levelId3'];
|
||||
$p_user['userId'] && $unpay['cfUserId'] = $p_user['userId'];
|
||||
$this->market_sylive_order_model->add($unpay);
|
||||
$order_id = $this->market_sylive_order_model->add($unpay);
|
||||
//添加kpi
|
||||
$params = ['a_id' => $a_id, 'uid' => $this->uid,'cf_uid' => $act_user_row['channelId'], 'kpi' => 'beforeOrder'];
|
||||
$order_id && $params['tagId'] = intval($order_id);
|
||||
$params['itemId'] = $itemId;
|
||||
$params['jsondata'] = [
|
||||
'sid' => $unpay['sid'],
|
||||
'order_id' => intval($order_id)
|
||||
];
|
||||
$this->sylive2_entity->kpi_log($params);
|
||||
}
|
||||
}
|
||||
$redis->delete($key);
|
||||
|
||||
@@ -253,7 +253,7 @@ class Wx extends Common{
|
||||
$ma_user = '';
|
||||
$user = $this->user_model->get(['userId'=>$this->uid,'maJiaId>'=>0]);
|
||||
$user['maJiaId'] && $ma_user = $this->user_model->get(['userId'=>$user['maJiaId'],'status'=>0]);
|
||||
if($ma_user){
|
||||
if($ma_user && !$param['cf_uid']){
|
||||
$where = ['activityId' => $param['a_id'], 'status' => 0, "userId" => $ma_user['userId']];
|
||||
$row_wechat = $this->groups_user_model->get($where); //管理员用户
|
||||
!$row_wechat && $row_wechat = $this->user_model->get(['status'=>0,'userId'=>$ma_user['userId']]);//普通用户角色
|
||||
|
||||
Reference in New Issue
Block a user