edit-sylive-biz
This commit is contained in:
@@ -34,6 +34,26 @@ class Act extends Wx {
|
||||
if(!$row){
|
||||
throw new Hd_exception('参数错误',400);
|
||||
}
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$bottoms = [];
|
||||
if($jsondata['bottoms']){
|
||||
foreach ($jsondata['bottoms'] as $key=>$val) {
|
||||
$temp = [
|
||||
'title' => $val['title'],
|
||||
'icon' => build_qiniu_image_url($val['icon'])
|
||||
];
|
||||
if($val['urlType']=='miniProgram'){
|
||||
$temp['type'] = 1;
|
||||
$temp['wechat_ghid'] = $val['miniProgramId'];
|
||||
$temp['wechat_path'] = $val['url'];
|
||||
}else{
|
||||
$temp['type'] = 2;
|
||||
$temp['url'] = $val['url'];
|
||||
}
|
||||
$bottoms[] = $temp;
|
||||
}
|
||||
}
|
||||
$info['menu'] = $bottoms;
|
||||
$user = $this->user_model->get(['userId'=>$this->uid],'unionid,nickname,headimg');
|
||||
$timeStart = strtotime($row['timeStart']);
|
||||
$info['s_time'] = time() < $timeStart ? $timeStart-time() : 0;
|
||||
|
||||
@@ -9,7 +9,9 @@ class Biz extends Admin{
|
||||
}
|
||||
//活动列表
|
||||
public function index(){
|
||||
$user = $this->user_model->get(['userId'=>$this->session['userId']]);
|
||||
$this->data['multi_org'] = $_SESSION[self::SESSION_KEY]['multi_org'] ? 1 : 0;
|
||||
$this->data['isBiz'] = $user['bizId'] ? 1 : 0;
|
||||
$this->show_view('h5/market/sylive2/biz/index');
|
||||
}
|
||||
|
||||
@@ -21,6 +23,7 @@ class Biz extends Admin{
|
||||
$where = [
|
||||
'userId' => $this->uid,
|
||||
'status' => 0,
|
||||
'activityId in (select activityId from lc_market_sylive_activity where status=0)' => null
|
||||
];
|
||||
$total = $this->groups_user_model->count($where);
|
||||
$rows = $this->groups_user_model->select($where,'activityId desc',$page,$size);
|
||||
|
||||
@@ -188,6 +188,8 @@ class Admin extends Common{
|
||||
$_SESSION[self::WX_SESSION] = $ret;
|
||||
header('Location:/h5/market/sylive2/login');exit;
|
||||
}
|
||||
//更新未绑定用户openid
|
||||
$row_wechat['mobile'] && $this->user_model->update(['openid'=>$openid],['mobile'=>$row_wechat['mobile'],'status'=>0]);
|
||||
$_SESSION[self::SESSION_KEY]['mobile'] = $row_wechat['mobile'];
|
||||
$org_url = http_host_com('home')."/h5/market/sylive2";
|
||||
redirect($org_url);
|
||||
|
||||
@@ -10,16 +10,17 @@ class User extends Admin
|
||||
parent::__construct();
|
||||
$this->load->model('market/Market_sylive_organization_model', 'mdSyliveOrganization');
|
||||
$this->load->library('market/sylive_entity');
|
||||
$this->biz_id = 0;
|
||||
$this->session['org_id'];
|
||||
$this->user = $this->user_model->get(['userId'=>$this->uid],'bizId,topOrgId');
|
||||
$this->biz_id = $this->user['bizId'];
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$row = $this->market_sylive_organization_model->get(['organizationId' => $this->biz_id]);
|
||||
$row = $this->market_sylive_organization_model->get(['organizationId' => $this->user['topOrgId']]);
|
||||
$biz_row = $this->market_sylive_organization_model->get(['organizationId' => $this->biz_id]);
|
||||
$headimg = $row['logo'] ? build_qiniu_image_url($row['logo']) : Sylive_entity::HD_IMG;
|
||||
$this->data['headimg'] = $headimg;
|
||||
$this->data['biz_name'] = $row['organizationName'];
|
||||
$this->data['biz_name'] = $biz_row['organizationName'];
|
||||
$this->data['biz_id'] = $this->biz_id;
|
||||
//微信分享
|
||||
$wx_info = $this->share_info();
|
||||
@@ -76,27 +77,39 @@ class User extends Admin
|
||||
$this->show_json('', 400, '门店未添加顾问类型,请联系管理员');
|
||||
}
|
||||
$organizationId = $re_org['organizationId'];
|
||||
$topOrgId = $this->getTopOrgId($organizationId);
|
||||
$topOrgId = $this->user['topOrgId'];
|
||||
$re = $this->user_model->get(['mobile' => $mobile, 'topOrgId' => $topOrgId]);
|
||||
if ($re && $re['status'] != -1) {
|
||||
if ($re['teamId'] || $re['organizationId']) {
|
||||
$this->show_json('', 400, '手机号已存在');
|
||||
}
|
||||
$this->show_json('', 400, '手机号已存在');
|
||||
}
|
||||
$addDate = ['topOrgId' => $topOrgId, 'organizationId' => $organizationId, 'biz_id' => $this->biz_id,
|
||||
$addDate = ['topOrgId' => $topOrgId, 'organizationId' => $organizationId, 'bizId' => $this->biz_id,
|
||||
'uname' => $uname, 'status' => 0, 'teamId' => 0];
|
||||
if ($re['userId']) {
|
||||
$this->user_model->update($addDate, ['userId' => $re['userId']]);
|
||||
$this->show_json('', 200, '绑定用户成功');
|
||||
} else {
|
||||
$addDate['mobile'] = $mobile;
|
||||
$addDate['createTime'] = date('Y-m-d H:i:s');
|
||||
$id = $this->user_model->add($addDate);
|
||||
if (!$id) {
|
||||
$this->show_json('', 400, '添加用户失败');
|
||||
}
|
||||
$this->show_json('', 200, '操作成功');
|
||||
$addDate['mobile'] = $mobile;
|
||||
$addDate['createTime'] = date('Y-m-d H:i:s');
|
||||
$id = $this->user_model->add($addDate);
|
||||
if (!$id) {
|
||||
$this->show_json('', 400, '添加用户失败');
|
||||
}
|
||||
//所有分组添加顾问
|
||||
$filed = 'activityId,groupsId,bizId,levelId1,levelId2,levelId3,userFrom';
|
||||
$admin_lists = $this->groups_user_model->select(['userId'=>$this->uid],'groupsUserId desc',0,0,$filed);
|
||||
if($admin_lists){
|
||||
foreach ($admin_lists as $key => $val) {
|
||||
$add_data[] = [
|
||||
'activityId' => $val['activityId'],
|
||||
'groupsId' => $val['groupsId'],
|
||||
'bizId' => $val['bizId'],
|
||||
'levelId1' => $val['levelId1'],
|
||||
'levelId2' => $val['levelId2'],
|
||||
'levelId3' => $val['levelId3'],
|
||||
'userFrom' => $val['userFrom'],
|
||||
'userId' => $id,
|
||||
'createTime' => time()
|
||||
];
|
||||
}
|
||||
$this->groups_user_model->add_batch($add_data);
|
||||
}
|
||||
$this->show_json('', 200, '操作成功');
|
||||
}
|
||||
|
||||
public function edit()
|
||||
@@ -142,28 +155,4 @@ class User extends Admin
|
||||
$this->user_model->update(['status' => $status], ['userId' => $userId]);
|
||||
$this->show_json('', 200, '操作成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:获取顶级机构id
|
||||
* Created on: 2022/12/8 14:39
|
||||
* Created by: dengbw
|
||||
* @param $organizationId
|
||||
* @param $topOrgId
|
||||
* @return mixed
|
||||
*/
|
||||
private function getTopOrgId($organizationId, $topOrgId = 0)
|
||||
{
|
||||
$re = $this->mdSyliveOrganization->get(['organizationId' => $organizationId], 'organizationId,parentId');
|
||||
if (!$re) {
|
||||
return $topOrgId;
|
||||
} else {
|
||||
$topOrgId = $re['organizationId'];
|
||||
if ($re['parentId']) {
|
||||
return $this->getTopOrgId($re['parentId'], $topOrgId);
|
||||
} else {
|
||||
return $topOrgId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
<body class="bg-fff">
|
||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||
<div class="bg-fff" id="app" ref="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top" :style="'background-image:url('+info.bg+')'">
|
||||
<div class="absolute top-0 right-0 bg-fff mt40 mr25 pl20 pr20 ulib-r750 fn-flex overflowhidden font-20">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top">
|
||||
<img class="block wp100" :src="info.bg" alt="#" />
|
||||
<div class="fixed top-0 right-0 bg-fff mt40 mr25 pl20 pr20 ulib-r750 fn-flex overflowhidden font-20">
|
||||
<a class="fn-flex-item pt10 pb10 pl20 pr20" v-if="info.statisticsurl" :href="info.statisticsurl">
|
||||
<img class="imgsize-40X40" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shuju.png" alt="#">
|
||||
<div class="text-middle">数据</div>
|
||||
@@ -16,9 +17,8 @@
|
||||
<div class="text-middle">分享</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="height-1200"></div>
|
||||
|
||||
<div class="fixed left-0 bottom-0 right-0 inner20 bg-fff ulib-rt20 z-index-4 fn-flex text-center" >
|
||||
<div class="fixed left-0 bottom-0 right-0 inner20 pb40 bg-fff ulib-rt20 z-index-4 fn-flex text-center" >
|
||||
<div class="relative fn-flex-item pl20 pr20" flexsize="0" v-for="item in info.menu">
|
||||
<a v-if="item.type==1" :href="item.url">
|
||||
<img class="imgsize-50X50" :src="item.icon" alt="#">
|
||||
@@ -162,21 +162,21 @@
|
||||
//获取基础信息
|
||||
getInfo(){
|
||||
this.info = <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>;
|
||||
this.info['menu'] = [
|
||||
{
|
||||
type:'2',
|
||||
icon:'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shijia.png',
|
||||
title:'约试驾',
|
||||
wechat_ghid:'gh_54cc250f3a1a',
|
||||
wechat_path:'subpackage/pages/testDrive/testDrive',
|
||||
},
|
||||
{
|
||||
type:'1',
|
||||
icon:'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shangpin.png',
|
||||
title:'热商品',
|
||||
url:'goods.html',
|
||||
},
|
||||
]
|
||||
// this.info['menu'] = [
|
||||
// {
|
||||
// type:'2',
|
||||
// icon:'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shijia.png',
|
||||
// title:'约试驾',
|
||||
// wechat_ghid:'gh_54cc250f3a1a',
|
||||
// wechat_path:'subpackage/pages/testDrive/testDrive',
|
||||
// },
|
||||
// {
|
||||
// type:'1',
|
||||
// icon:'https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-shangpin.png',
|
||||
// title:'热商品',
|
||||
// url:'goods.html',
|
||||
// },
|
||||
// ]
|
||||
// this.info = {
|
||||
// state:0,//0未开始,1直播中,2结束
|
||||
// bg:"https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/linebg.jpg",
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="swiper-pagination ulib-rl750"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
<a class="block fn-fl pt10 pb10 pl20 pr20 bg-ccc font-28 ulib-r750" href="javascript:;" @click="logout()">
|
||||
<i class="iconfont icon-tuichu text-middle"></i><span class="ml5 text-middle">退出</span>
|
||||
</a>
|
||||
<?if($isBiz){?>
|
||||
<a class="block fn-fr pt10 pb10 pl20 pr20 bg-333 font-28 color-fff ulib-r750" href="/h5/market/sylive2/user">
|
||||
<i class="iconfont icon-guanli text-middle"></i><span class="ml5 text-middle">顾问管理</span>
|
||||
</a>
|
||||
<?}?>
|
||||
<?if($multi_org){?>
|
||||
<a class="block fn-fr pt10 pb10 pl20 pr20 bg-333 font-28 color-fff ulib-r750" href="/h5/market/sylive2">
|
||||
<i class="iconfont icon-qiehuan1 text-middle"></i><span class="ml5 text-middle">切换机构</span>
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title><?=$_title?></title>
|
||||
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?20221106">
|
||||
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/swiper/css/swiper.min.css">
|
||||
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?202212091">
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/jquery.3.4.1.min.js"></script>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/vue.2.6.10.min.js"></script>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/mDialog.js"></script>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
<div class="absolute bp20 left-0 right-0 pl100 pr100 text-center fn-flex fn-flex-wrap">
|
||||
<a class="block wp50" :href="item.url" v-for="item in list">
|
||||
<img class='inline-block imgsize-210X210 box-shadow-lightGray ulib-r750' :src='item.logo' />
|
||||
<img class='inline-block imgsize-210X210 ulib-r750' :src='item.logo' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user