h5_team_1104
This commit is contained in:
@@ -45,7 +45,7 @@ class Team extends Admin{
|
||||
$row = $this->market_sylive_team_model->get(['teamId'=>$team_id]);
|
||||
$this->data['headimg'] = Sylive_entity::DF_IMG;
|
||||
$this->data['biz_name'] = $row['teamName'];
|
||||
$this->data['team_id'] = $this->input->get('team_id');
|
||||
$this->data['team_id'] = $team_id;
|
||||
$this->data['teamLevel'] = $this->teamLevel;
|
||||
//微信分享
|
||||
$wx_info = $this->share_info();
|
||||
|
||||
@@ -13,9 +13,12 @@ class User extends Admin
|
||||
$this->load->model('market/Market_sylive_organization_model', 'mdSyliveOrganization');
|
||||
$this->load->library('market/sylive_entity');
|
||||
$this->group_id = $this->sylive_entity->get_level($this->session['org_id']);
|
||||
$biz_id = intval($this->input->get('biz_id'));
|
||||
!$biz_id && $biz_id = intval($this->input->post('biz_id'));
|
||||
$this->group_id == 2 && $biz_id = $this->session['org_id'];
|
||||
if ($this->group_id == 2) {
|
||||
$biz_id = $this->session['org_id'];
|
||||
} else {
|
||||
$biz_id = intval($this->input->get('biz_id'));
|
||||
!$biz_id && $biz_id = intval($this->input->post('biz_id'));
|
||||
}
|
||||
$this->biz_id = $biz_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
require_once 'Common.php';
|
||||
|
||||
class UserTeam extends Admin
|
||||
{
|
||||
private $teamLevel;
|
||||
private $team_id;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('market/Market_sylive_user_model', 'mdSyliveUser');
|
||||
$this->load->model('market/Market_sylive_team_model', 'mdSyliveTeam');
|
||||
$this->load->library('market/sylive_entity');
|
||||
$this->teamLevel = $this->sylive_entity->get_team_level($this->session['teamId']);
|
||||
if ($this->teamLevel == 1) {
|
||||
$team_id = $this->session['teamId'];
|
||||
} else {
|
||||
$team_id = intval($this->input->get('team_id'));
|
||||
!$team_id && $team_id = intval($this->input->post('team_id'));
|
||||
}
|
||||
$this->team_id = $team_id;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
if ($this->teamLevel != 1) {
|
||||
throw new Hd_exception('权限不足', 400);
|
||||
}
|
||||
$row = $this->mdSyliveTeam->get(['teamId' => $this->team_id]);
|
||||
$this->data['headimg'] = Sylive_entity::DF_IMG;
|
||||
$this->data['team_name'] = $row['teamName'];
|
||||
$this->data['team_id'] = $this->team_id;
|
||||
//微信分享
|
||||
$wx_info = $this->share_info();
|
||||
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||
$this->show_view('h5/market/sylive/user/team');
|
||||
}
|
||||
|
||||
public function lists()
|
||||
{
|
||||
if ($this->teamLevel != 1) {
|
||||
$this->show_json('', 400, '权限不足');
|
||||
}
|
||||
$keyWord = $this->input->get('keyWord');
|
||||
$page = intval($this->input->get('page'));
|
||||
$size = intval($this->input->get('size'));
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 10;
|
||||
$where = [
|
||||
'status<>' => -1,
|
||||
"teamId in (select teamId from lc_market_sylive_team where parentId={$this->team_id})" => null
|
||||
];
|
||||
$keyWord && $where["uname like '%{$keyWord}%'"] = null;
|
||||
$total = $this->user_model->count($where);
|
||||
$lists = [];
|
||||
if ($total) {
|
||||
$res = $this->user_model->select($where, 'userId desc', $page, $size, 'userId,mobile,uname,nickname,headimg,status');
|
||||
foreach ($res as $val) {
|
||||
$temp = [
|
||||
'userId' => $val['userId'],
|
||||
'status' => $val['status'],
|
||||
'uname' => $val['uname'],
|
||||
'mobile' => $val['mobile'],
|
||||
'wxuname' => $val['nickname'],
|
||||
'wxheadimg' => $val['headimg']
|
||||
];
|
||||
$lists[] = $temp;
|
||||
}
|
||||
}
|
||||
$data['list'] = $lists;
|
||||
$data['total'] = $total;
|
||||
$this->show_json($data, 200);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
if ($this->teamLevel != 1) {
|
||||
$this->show_json('', 400, '权限不足');
|
||||
}
|
||||
$uname = $this->input->post('uname');
|
||||
$mobile = $this->input->post('mobile');
|
||||
if (!$uname) {
|
||||
$this->show_json('', 400, '请输入团员姓名');
|
||||
}
|
||||
if (!mobile_valid($mobile)) {
|
||||
$this->show_json('', 400, '请输入正确手机号');
|
||||
}
|
||||
$re_team = $this->mdSyliveTeam->get(['parentId' => $this->team_id, 'teamType' => 3, 'status' => 0]);
|
||||
if (!$re_team) {
|
||||
$this->show_json('', 400, '门店未添加团员类型,请联系管理员');
|
||||
}
|
||||
$teamId = $re_team['teamId'];
|
||||
$re = $this->user_model->get(['mobile' => $mobile]);
|
||||
if ($re && $re['status'] != -1) {
|
||||
if ($re['teamId'] || $re['organizationId']) {
|
||||
$this->show_json('', 400, '手机号已存在');
|
||||
}
|
||||
}
|
||||
$addDate = ['teamId' => $teamId, 'uname' => $uname, 'status' => 0, 'organizationId' => 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, '操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
if ($this->teamLevel != 1) {
|
||||
$this->show_json('', 400, '权限不足');
|
||||
}
|
||||
$uname = $this->input->post('uname');
|
||||
$mobile = $this->input->post('mobile');
|
||||
$userId = intval($this->input->post('userId'));
|
||||
if (!$userId) {
|
||||
$this->show_json('', 400, '参数错误');
|
||||
}
|
||||
if (!$uname) {
|
||||
$this->show_json('', 400, '请输入团员姓名');
|
||||
}
|
||||
if (!mobile_valid($mobile)) {
|
||||
$this->show_json('', 400, '请输入正确手机号');
|
||||
}
|
||||
$re = $this->user_model->get(['userId' => $userId]);
|
||||
if (!$re) {
|
||||
$this->show_json('', 400, '无此团员');
|
||||
}
|
||||
if ($re['mobile'] == $mobile) {
|
||||
$uppDate = ['uname' => $uname];
|
||||
} else {
|
||||
$re = $this->user_model->get(['mobile' => $mobile]);
|
||||
if ($re && $re['status'] != -1) {
|
||||
if ($re['teamId'] || $re['organizationId']) {
|
||||
$this->show_json('', 400, '手机号已存在');
|
||||
}
|
||||
}
|
||||
$uppDate = ['uname' => $uname, 'mobile' => $mobile];
|
||||
}
|
||||
$this->user_model->update($uppDate, ['userId' => $re['userId']]);
|
||||
$this->show_json('', 200, '操作成功');
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
if ($this->teamLevel != 1) {
|
||||
$this->show_json('', 400, '权限不足');
|
||||
}
|
||||
$userId = intval($this->input->post('userId'));
|
||||
$status = intval($this->input->post('status'));
|
||||
if (!$userId) {
|
||||
$this->show_json('', 400, '参数错误');
|
||||
}
|
||||
$this->user_model->update(['status' => $status], ['userId' => $userId]);
|
||||
$this->show_json('', 200, '操作成功');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
<body class="bg-f6">
|
||||
<div id="app" ref="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top" style="background-image:url(https://qs.haodian.cn/web/images/project/H5-ShiYu/theme-bg.png?v=221008)">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top"
|
||||
style="background-image:url(https://qs.haodian.cn/web/images/project/H5-ShiYu/theme-bg.png?v=221008)">
|
||||
<div class="pt30 pb30">
|
||||
<div class="pl30 pr30">
|
||||
<img class="text-middle imgsize-35X35 ulib-r750" :src="info.headimg" alt="#" />
|
||||
<span class="text-middle font-22 color-fff">{{info.nickname}}</span>
|
||||
<a class="fn-fr font-22 color-fff bg-000-op50 ulib-r750 pt5 pb5 pl10 pr10" href="javascript:;" @click="logout()">
|
||||
<span class="text-middle ml10">退出</span>
|
||||
</a>
|
||||
<img class="text-middle imgsize-60X60 ulib-r750" :src="info.headimg" alt="#"/>
|
||||
<span class="text-middle font-28 color-fff">{{info.nickname}}</span>
|
||||
<a class="fn-fr font-22 bg-fff ulib-r750 pt5 pb5 pl15 pr15" href="javascript:void(0);"
|
||||
@click="logout()"><i class="iconfont icon-tuichu text-middle"></i><span
|
||||
class="text-middle ml10">退出</span></a>
|
||||
</div>
|
||||
<div class="fn-flex mt40 text-center color-fff">
|
||||
<div class="fn-flex-item" v-for="item in info.count">
|
||||
@@ -23,26 +24,36 @@
|
||||
<div class="height-60"></div>
|
||||
<div class="fixed top-0 left-0 right-0 z-index-10 bg-fff pl30 pr30 pt20 pb20">
|
||||
<div class="relative height-60 ml50 mr50 fn-flex text-center">
|
||||
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
|
||||
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a
|
||||
:class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']"
|
||||
@click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
|
||||
<div :class="'glider glider-'+tabIndex"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="relative height-60 ml50 mr50 fn-flex text-center">
|
||||
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a :class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']" @click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
|
||||
<div class="fn-flex-item" v-for="(item,index) in info.tab"><a
|
||||
:class="'relative inline-block tab-menu '+ [tabid == item.id?'font-36 active':'font-32']"
|
||||
@click="changeTab(item.id,index)" href="javascript:">{{item.title}}</a></div>
|
||||
<div :class="'glider glider-'+tabIndex"></div>
|
||||
</div>
|
||||
<div class="pt30">
|
||||
<!--大区列表-->
|
||||
<div v-if="tabid==1">
|
||||
<a class="block relative mb30 bg-f9 pt20 pb20 pl30 pr200 ulib-r20" v-for="(item,index) in list" :href="item.url">
|
||||
<a class="block relative mb30 bg-f9 pt20 pb20 pl30 pr200 ulib-r20" v-for="(item,index) in list"
|
||||
:href="item.url">
|
||||
<div class="font-32">{{item.title}}</div>
|
||||
<div class="mt20 font-22 color-999">
|
||||
<span><i class="iconfont icon-mendian text-middle"></i><span class="text-middle ml10 font-22">团员</span><span class="text-middle ml10 font-22">{{item.storenum}}</span></span>
|
||||
<span class="ml20"><i class="iconfont icon-huodong text-middle"></i><span class="text-middle ml10 font-22">活动</span><span class="text-middle ml10 font-22">{{item.activitynum}}</span></span>
|
||||
<span><i class="iconfont icon-mendian text-middle"></i><span
|
||||
class="text-middle ml10 font-22">团员</span><span
|
||||
class="text-middle ml10 font-22">{{item.storenum}}</span></span>
|
||||
<span class="ml20"><i class="iconfont icon-huodong text-middle"></i><span
|
||||
class="text-middle ml10 font-22">活动</span><span
|
||||
class="text-middle ml10 font-22">{{item.activitynum}}</span></span>
|
||||
</div>
|
||||
<div class="absolute right-0 box-middle pr30">
|
||||
<span :class="'inline-block pl10 pr10 line-height-15 text-middle ulib-r750 font-22 color-fff '+item.state.class" v-if="item.state.title">{{item.state.title}}</span>
|
||||
<span :class="'inline-block pl10 pr10 line-height-15 text-middle ulib-r750 font-22 color-fff '+item.state.class"
|
||||
v-if="item.state.title">{{item.state.title}}</span>
|
||||
<i class="text-middle iconfont icon-gengduo text-middle font-28 color-666"></i>
|
||||
</div>
|
||||
</a>
|
||||
@@ -54,7 +65,9 @@
|
||||
<div class="space-nowrap">
|
||||
<a class="inline-block actitle font-32" :href="item.url">{{item.title}}</a>
|
||||
<a class="inline-block vertical10" :href="item.stat_url">
|
||||
<div class="inline-block pl20 pr20 line-height-15 text-middle ulib-r750 font-22 color-fff bg-fe9538"><i class="iconfont icon-shuju text-middle"></i><span class="text-middle ml5">数据</span></div>
|
||||
<div class="inline-block pl20 pr20 line-height-15 text-middle ulib-r750 font-22 color-fff bg-fe9538">
|
||||
<i class="iconfont icon-shuju text-middle"></i><span
|
||||
class="text-middle ml5">数据</span></div>
|
||||
</a>
|
||||
</div>
|
||||
<a class="block mt10 font-22 color-999" :href="item.url">
|
||||
@@ -66,9 +79,13 @@
|
||||
<!--end活动列表-->
|
||||
</div>
|
||||
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span></div>
|
||||
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
|
||||
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd && list.length>10">我们是有底线的</div>
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span>
|
||||
</div>
|
||||
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i
|
||||
class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span>
|
||||
</div>
|
||||
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd && list.length>10">我们是有底线的
|
||||
</div>
|
||||
</mugen-scroll>
|
||||
</div>
|
||||
</div>
|
||||
@@ -79,23 +96,21 @@
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
tabFixed:false,
|
||||
tabIndex:0,
|
||||
tabid:'1',//1大区列表 /2活动列表
|
||||
info:'',//基础信息
|
||||
tabFixed: false,
|
||||
tabIndex: 0,
|
||||
tabid: '1',//1大区列表 /2活动列表
|
||||
info: '',//基础信息
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1, //页数
|
||||
size: 20, //每页取多少个数据
|
||||
list:[],
|
||||
list: [],
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
created() {
|
||||
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
window.addEventListener('scroll', this.handleScroll, true)
|
||||
this.getInfo()
|
||||
@@ -104,23 +119,23 @@
|
||||
|
||||
},
|
||||
//离开页面时
|
||||
destroyed () {
|
||||
destroyed() {
|
||||
window.removeEventListener('scroll', this.handleScroll)
|
||||
},
|
||||
methods: {
|
||||
|
||||
//获取基础信息
|
||||
getInfo(){
|
||||
getInfo() {
|
||||
var that = this;
|
||||
that.info = <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>
|
||||
that.info = <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>
|
||||
},
|
||||
|
||||
//tab切换
|
||||
changeTab(id,index){
|
||||
if(id != this.tabid&&!this.loading){
|
||||
if(this.tabFixed){
|
||||
changeTab(id, index) {
|
||||
if (id != this.tabid && !this.loading) {
|
||||
if (this.tabFixed) {
|
||||
let mainoffsetTop = document.querySelector('#main').offsetTop
|
||||
$('html,body').animate({scrollTop: mainoffsetTop+5},500);
|
||||
$('html,body').animate({scrollTop: mainoffsetTop + 5}, 500);
|
||||
}
|
||||
this.tabid = id
|
||||
this.tabIndex = index
|
||||
@@ -128,16 +143,16 @@
|
||||
this.isNoData = false
|
||||
this.page = 1
|
||||
this.list = []
|
||||
if(this.tabid == 1){
|
||||
if (this.tabid == 1) {
|
||||
this.getRegionList()
|
||||
}else if(this.tabid == 2){
|
||||
} else if (this.tabid == 2) {
|
||||
this.getActivityList()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//判断导航是否需要吸顶
|
||||
handleScroll () {
|
||||
handleScroll() {
|
||||
let scrollTop = document.querySelector('#app').scrollTop
|
||||
let mainoffsetTop = document.querySelector('#main').offsetTop
|
||||
if (scrollTop > mainoffsetTop) {
|
||||
@@ -148,20 +163,20 @@
|
||||
},
|
||||
|
||||
//拉取数据
|
||||
fetchData: function() {
|
||||
if(this.tabid == 1){
|
||||
fetchData: function () {
|
||||
if (this.tabid == 1) {
|
||||
this.getRegionList()
|
||||
}else if(this.tabid == 2){
|
||||
} else if (this.tabid == 2) {
|
||||
this.getActivityList()
|
||||
}
|
||||
},
|
||||
|
||||
//获取大区列表
|
||||
getRegionList(){
|
||||
let that=this;
|
||||
getRegionList() {
|
||||
let that = this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
$.get('/h5/market/sylive/team/team_list',{'page':that.page},function (result) {
|
||||
$.get('/h5/market/sylive/team/team_list', {'page': that.page}, function (result) {
|
||||
that.loading = false;
|
||||
that.page = that.page + 1;
|
||||
that.list = that.list.concat(result.data.list);
|
||||
@@ -170,16 +185,16 @@
|
||||
} else if (that.list.length == result.data.total) {
|
||||
that.isDataEnd = true;
|
||||
}
|
||||
},'json')
|
||||
}, 'json')
|
||||
}
|
||||
},
|
||||
//获取活动列表
|
||||
getActivityList(){
|
||||
let that=this;
|
||||
getActivityList() {
|
||||
let that = this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive/team/act_list',{'page':that.page},function (result) {
|
||||
$.get('/h5/market/sylive/team/act_list', {'page': that.page}, function (result) {
|
||||
that.loading = false;
|
||||
that.page = that.page + 1;
|
||||
that.list = that.list.concat(result.data.list);
|
||||
@@ -188,31 +203,31 @@
|
||||
} else if (that.list.length == result.data.total) {
|
||||
that.isDataEnd = true;
|
||||
}
|
||||
},'json')
|
||||
}, 'json')
|
||||
}
|
||||
},
|
||||
logout(){
|
||||
$.get('/h5/market/sylive/login/logout',function (response) {
|
||||
if(response.code==200){
|
||||
logout() {
|
||||
$.get('/h5/market/sylive/login/logout', function (response) {
|
||||
if (response.code == 200) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg,
|
||||
onClose:function(){
|
||||
onClose: function () {
|
||||
window.location = '/h5/market/sylive/login'
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg
|
||||
});
|
||||
}
|
||||
},'json')
|
||||
}, 'json')
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/hidden_wx_share')?>
|
||||
<?= $this->load->view('h5/market/sylive/hidden_wx_share') ?>
|
||||
</body>
|
||||
@@ -1,48 +1,60 @@
|
||||
<body class="bg-f6">
|
||||
<div id="app" ref="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb50" style="background-image:url(https://qs.haodian.cn/web/images/project/H5-ShiYu/theme-bg.png?v=221008)">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb50"
|
||||
style="background-image:url(https://qs.haodian.cn/web/images/project/H5-ShiYu/theme-bg.png?v=221008)">
|
||||
<div class="pt30 pb60">
|
||||
<div class="relative pl30 pr30 fn-clear">
|
||||
<?if($teamLevel<1){?>
|
||||
<a class="fn-fr font-22 color-fff bg-000-op50 ulib-r750 pt5 pb5 pl10 pr10" href="/h5/market/sylive/team">
|
||||
<i class="iconfont icon-qiehuan text-middle"></i><span class="text-middle ml10">切换团队</span>
|
||||
</a>
|
||||
<?}else{?>
|
||||
<a class="fn-fr font-22 color-fff bg-000-op50 ulib-r750 pt5 pb5 pl10 pr10" href="javascript:;" @click="logout()">
|
||||
<span class="text-middle ml10">退出</span>
|
||||
</a>
|
||||
<?}?>
|
||||
<? if ($teamLevel == 1) { ?>
|
||||
<a class="fn-fl font-22 bg-fff ulib-r750 pt5 pb5 pl15 pr15"
|
||||
href="/h5/market/sylive/userTeam?team_id=<?= $team_id ?>"><i
|
||||
class="iconfont icon-guanli text-middle"></i><span class="text-middle ml10">团员管理</span></a>
|
||||
<? } ?>
|
||||
<? if ($teamLevel < 1) { ?>
|
||||
<a class="fn-fr font-22 bg-fff ulib-r750 pt5 pb5 pl15 pr15"
|
||||
href="/h5/market/sylive/team">
|
||||
<i class="iconfont icon-qiehuan text-middle"></i><span class="text-middle ml10">切换团队</span></a>
|
||||
<? } else { ?>
|
||||
<a class="fn-fr font-22 bg-fff ulib-r750 pt5 pb5 pl15 pr15" href="javascript:void(0);"
|
||||
@click="logout()"><i class="iconfont icon-tuichu text-middle"></i><span
|
||||
class="text-middle ml10">退出</span></a>
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative bg-fff mt10 ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:75vh;">
|
||||
<img class="absolute top--60 box-center bds-1-fff imgsize-120X120 ulib-r750 z-index-1" :src="info.logo" alt="#" />
|
||||
<img class="absolute top--60 box-center bds-1-fff imgsize-120X120 ulib-r750 z-index-1" :src="info.logo"
|
||||
alt="#"/>
|
||||
<div class="pt50 font-36 text-center">{{info.title}}</div>
|
||||
<div class="pt50">
|
||||
<!--活动列表列表-->
|
||||
<div :class="['relative mb30 bg-f9 pt20 pb20 pl30 ulib-r20 ',item.pay_status == 0 ? 'pr200' : 'pr100']" v-for="(item,index) in list">
|
||||
<div :class="['relative mb30 bg-f9 pt20 pb20 pl30 ulib-r20 ',item.pay_status == 0 ? 'pr200' : 'pr100']"
|
||||
v-for="(item,index) in list">
|
||||
<div class="space-nowrap">
|
||||
<a class="inline-block actitle font-32" href="javascript:;" @click="gourl(item.url)">{{item.title}}</a>
|
||||
<a class="inline-block vertical10" href="javascript:;" @click="gourl(item.stat_url)">
|
||||
<div class="inline-block pl20 pr20 line-height-15 text-middle ulib-r750 font-22 color-fff bg-fe9538"><i class="iconfont icon-shuju text-middle"></i><span class="text-middle ml5">数据</span></div>
|
||||
<div class="inline-block pl20 pr20 line-height-15 text-middle ulib-r750 font-22 color-fff bg-fe9538">
|
||||
<i class="iconfont icon-shuju text-middle"></i><span class="text-middle ml5">数据</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<a class="block mt10 font-22 color-999" href="javascript:;" @click="gourl(item.url)">
|
||||
{{item.time}}
|
||||
<a :href="item.url" class="absolute right-0 mr20 box-middle iconfont icon-gengduo font-26 color-666"></a>
|
||||
<a :href="item.url"
|
||||
class="absolute right-0 mr20 box-middle iconfont icon-gengduo font-26 color-666"></a>
|
||||
</a>
|
||||
</div>
|
||||
<!--end活动列表-->
|
||||
</div>
|
||||
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span></div>
|
||||
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
|
||||
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd && list.length>10">我们是有底线的</div>
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span>
|
||||
</div>
|
||||
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i
|
||||
class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span>
|
||||
</div>
|
||||
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd && list.length>10">我们是有底线的
|
||||
</div>
|
||||
</mugen-scroll>
|
||||
</div>
|
||||
</div>
|
||||
<?if($group_id<2){?>
|
||||
<?$this->load->view('h5/market/sylive/nav')?>
|
||||
<?}?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -50,20 +62,18 @@
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
info:'',//基础信息
|
||||
info: '',//基础信息
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1, //页数
|
||||
size: 10, //每页取多少个数据
|
||||
list:[],
|
||||
list: [],
|
||||
},
|
||||
created(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
created() {
|
||||
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
this.getInfo()
|
||||
},
|
||||
@@ -71,31 +81,34 @@
|
||||
|
||||
},
|
||||
//离开页面时
|
||||
destroyed () {
|
||||
destroyed() {
|
||||
},
|
||||
methods: {
|
||||
|
||||
//获取基础信息
|
||||
getInfo(){
|
||||
getInfo() {
|
||||
this.info = {
|
||||
title:"<?=$biz_name?>",
|
||||
logo:"<?=$headimg?>",
|
||||
title: "<?=$biz_name?>",
|
||||
logo: "<?=$headimg?>",
|
||||
}
|
||||
},
|
||||
|
||||
//拉取数据
|
||||
fetchData: function() {
|
||||
fetchData: function () {
|
||||
this.getActivityList()
|
||||
},
|
||||
|
||||
//获取大区列表
|
||||
getActivityList(){
|
||||
let that=this;
|
||||
getActivityList() {
|
||||
let that = this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求接口
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive/team/act_list',{'team_id':<?=$team_id ? $team_id : 0?>,'page':that.page},function (result) {
|
||||
$.get('/h5/market/sylive/team/act_list', {
|
||||
'team_id':<?=$team_id ? $team_id : 0?>,
|
||||
'page': that.page
|
||||
}, function (result) {
|
||||
that.loading = false;
|
||||
that.page = that.page + 1;
|
||||
that.list = that.list.concat(result.data.list);
|
||||
@@ -104,36 +117,36 @@
|
||||
} else if (that.list.length == result.data.total) {
|
||||
that.isDataEnd = true;
|
||||
}
|
||||
},'json')
|
||||
}, 'json')
|
||||
}
|
||||
},
|
||||
logout(){
|
||||
$.get('/h5/market/sylive/login/logout',function (response) {
|
||||
if(response.code==200){
|
||||
logout() {
|
||||
$.get('/h5/market/sylive/login/logout', function (response) {
|
||||
if (response.code == 200) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg,
|
||||
onClose:function(){
|
||||
onClose: function () {
|
||||
window.location = '/h5/market/sylive/login'
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: response.msg
|
||||
});
|
||||
}
|
||||
},'json')
|
||||
}, 'json')
|
||||
},
|
||||
gourl(url){
|
||||
if(url){
|
||||
window.location = url
|
||||
gourl(url) {
|
||||
if (url) {
|
||||
window.location = url
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?=$this->load->view('h5/market/sylive/hidden_wx_share')?>
|
||||
<?= $this->load->view('h5/market/sylive/hidden_wx_share') ?>
|
||||
</body>
|
||||
@@ -59,11 +59,7 @@
|
||||
<a class="block bg-1a1a1a pt25 pb25 text-center font-36 color-fff ulib-r10" @click="showForm(-1)"
|
||||
href="javascript:void(0)">新增顾问</a>
|
||||
</div>
|
||||
|
||||
<? if ($group_id < 2) { ?>
|
||||
<? $this->load->view('h5/market/sylive/nav') ?>
|
||||
<? } ?>
|
||||
|
||||
<? $this->load->view('h5/market/sylive/nav') ?>
|
||||
<div class="msg fn-hide" :style="isShowForm?'display:block':'display:none'" v-if="isShowForm">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
|
||||
@@ -0,0 +1,319 @@
|
||||
<body class="bg-f6">
|
||||
<div id="app" ref="app">
|
||||
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb150">
|
||||
<div class="inner30 fn-flex">
|
||||
<div class="fn-flex-item wp50 mr20">
|
||||
<div class="mt10 text-nowrap">
|
||||
<img class="text-middle imgsize-40X40 ulib-r750" :src="info.logo" alt="#"/>
|
||||
<span class="text-middle font-28">{{info.title}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fn-flex-item wp50 relative pt10 pb10 pl50 pr20 bg-ddd ulib-r750">
|
||||
<div class="absolute box-middle left-0 font-24 color-999 pl15 pr10 brs-1-999"><i
|
||||
class="iconfont icon-sousuo"></i></div>
|
||||
<input class="wp90 bg-ddd bds-1-ddd font-22 ulib-r750" type="search" class="ipt-seach"
|
||||
placeholder="请输入团员姓名" v-model="keyWord" @input="searchHandler"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative bg-fff ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:75vh;">
|
||||
<div>
|
||||
<!--团员列表-->
|
||||
<div class="relative mb30 bg-f9 pt20 pb20 pl30 pr200 ulib-r20" v-for="(item,index) in list">
|
||||
<div>
|
||||
<div class="font-28">{{item.uname}}·{{item.mobile}}</div>
|
||||
<div class="mt10 font-22 color-999" v-if="item.wxuname">
|
||||
<img class="text-middle imgsize-30X30 ulib-r750" :src="item.wxheadimg" alt="#"/>
|
||||
<span class="text-middle">{{item.wxuname}}</span>
|
||||
</div>
|
||||
<div class="mt10 font-22 color-999" v-else>暂未绑定微信</div>
|
||||
</div>
|
||||
<div class="absolute box-middle right-0 mr30 space-nowrap font-26">
|
||||
<a class="text-middle" href="javascript:void(0);" v-if="!item.wxuname" @click="showForm(index)">修改</a>
|
||||
<span class="text-middle font-22 pl5 pr5" v-if="!item.wxuname">|</span>
|
||||
<a class="text-middle" href="javascript:void(0);" @click="showDel(index)">删除</a>
|
||||
<span class="text-middle font-22 pl5 pr5">|</span>
|
||||
<a class="text-middle color-ffa85a" href="javascript:void(0);" v-if="item.status==1"
|
||||
@click=showAble(index)>启用</a>
|
||||
<a class="text-middle color-ffa85a" href="javascript:void(0);" v-else-if="item.status==0"
|
||||
@click=showAble(index)>禁用</a>
|
||||
</div>
|
||||
</div>
|
||||
<!--end活动列表-->
|
||||
</div>
|
||||
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
|
||||
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"><span
|
||||
class="text-middle font-22">暂无数据</span></div>
|
||||
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i
|
||||
class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span>
|
||||
</div>
|
||||
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd&&list.length>10">我们是有底线的</div>
|
||||
</mugen-scroll>
|
||||
</div>
|
||||
</div>
|
||||
<? $this->load->view('h5/market/sylive/nav') ?>
|
||||
<div class="fixed left-0 bottom-0 right-0 inner30 pt15 bg-fff z-index-2">
|
||||
<div class="pb15 text-center font-22 color-999">
|
||||
<i class="iconfont icon-xinxi text-middle"></i>
|
||||
<span class="text-middle">绑定微信后,信息无法修改</span>
|
||||
</div>
|
||||
<a class="block bg-1a1a1a pt25 pb25 text-center font-36 color-fff ulib-r10" @click="showForm(-1)"
|
||||
href="javascript:void(0)">新增团员</a>
|
||||
</div>
|
||||
<div class="msg fn-hide" :style="isShowForm?'display:block':'display:none'" v-if="isShowForm">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word">
|
||||
<div class="relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="text" v-model="uname"
|
||||
placeholder="请输入团员姓名"/>
|
||||
</div>
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="tel" v-model="mobile"
|
||||
placeholder="请输入手机号"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt30">
|
||||
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="submit()">{{formIndex>-1?'修改':'新增'}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowDel?'display:block':'display:none'" v-if="isShowDel">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content" style="padding:0;">
|
||||
<div class="pt60 pb60 pl40 pr40 text-center font-32">确认删除{{list[delIndex].uname}}"吗?"</div>
|
||||
<div class="fn-flex bts-1-eee text-center font-28">
|
||||
<a class="fn-flex-item pt30 pb30" href="javascript:void(0);" @click="delOpt()">确定</a>
|
||||
<a class="fn-flex-item pt30 pb30 bls-1-eee color-999" href="javascript:void(0);" @click="closeOpt">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowAble?'display:block':'display:none'" v-if="isShowAble">
|
||||
<div class="msgBg" @click="closeOpt"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content" style="padding:0;">
|
||||
<div class="pt60 pb60 pl40 pr40 text-center font-32">
|
||||
{{list[ableIndex].status==1?'确认启用':'确认禁用'}}{{list[ableIndex].uname}}"吗?"
|
||||
</div>
|
||||
<div class="fn-flex bts-1-eee text-center font-28">
|
||||
<a class="fn-flex-item pt30 pb30" href="javascript:void(0);" @click="ableOpt()">确定</a>
|
||||
<a class="fn-flex-item pt30 pb30 bls-1-eee color-999" href="javascript:void(0);" @click="closeOpt">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function _Debounce(fn, t) {
|
||||
let delay = t || 500;
|
||||
let timer;
|
||||
return function () {
|
||||
let args = arguments;
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
timer = null;
|
||||
fn.apply(this, args);
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
keyWord: '',
|
||||
info: {},
|
||||
loading: false,
|
||||
isDataEnd: false,
|
||||
isNoData: false,
|
||||
page: 1, //页数
|
||||
size: 10, //每页取多少个数据
|
||||
list: [],
|
||||
uname: '',
|
||||
mobile: '',
|
||||
isSubmiting: false,
|
||||
isRefresh: false,//是否是刷新列表,用于操作后刷新列表
|
||||
isShowForm: false,
|
||||
isShowDel: false,
|
||||
isShowAble: false,
|
||||
formIndex: -1,
|
||||
delIndex: -1,
|
||||
ableIndex: -1,
|
||||
},
|
||||
mounted() {
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
//获取基础信息
|
||||
getInfo() {
|
||||
this.info = {
|
||||
title: "<?=$team_name?>",
|
||||
logo: "<?=$headimg?>",
|
||||
}
|
||||
},
|
||||
//拉取数据
|
||||
fetchData: function () {
|
||||
this.getStaffList()
|
||||
},
|
||||
//团员列表
|
||||
searchHandler: _Debounce(function () {
|
||||
this.loading = false;
|
||||
this.isDataEnd = false;
|
||||
this.isNoData = false;
|
||||
this.page = 1;
|
||||
this.list = [];
|
||||
this.getStaffList()
|
||||
}, 250),
|
||||
//团员列表
|
||||
getStaffList() {
|
||||
let that = this;
|
||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||
that.loading = true;
|
||||
//请求参数
|
||||
let params = {};
|
||||
params['keyWord'] = that.keyWord;
|
||||
params['team_id'] = <?=$team_id?>;
|
||||
if (this.isRefresh) {//刷新列表参数
|
||||
this.page = this.page - 1;
|
||||
params['page'] = 1;
|
||||
params['size'] = this.page * this.size;
|
||||
} else {
|
||||
params['page'] = this.page;
|
||||
params['size'] = this.size;
|
||||
}
|
||||
//请求接口
|
||||
$.get('/h5/market/sylive/userTeam/lists', params, function (result) {
|
||||
that.loading = false;
|
||||
that.isRefresh = false;
|
||||
if (result.code == 200) {
|
||||
that.page = that.page + 1;
|
||||
that.list = that.list.concat(result.data.list);
|
||||
if (result.data.total == 0) {
|
||||
that.isNoData = true;
|
||||
} else if (that.list.length == result.data.total) {
|
||||
that.isDataEnd = true;
|
||||
}
|
||||
} else {
|
||||
mDialog.msg({content: result.msg});
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
},
|
||||
//关闭弹框
|
||||
closeOpt: function () {
|
||||
this.isShowForm = false;
|
||||
this.isShowDel = false;
|
||||
this.isShowAble = false;
|
||||
},
|
||||
//显示新增编辑弹框
|
||||
showForm(index) {
|
||||
this.formIndex = index;
|
||||
this.isShowForm = true;
|
||||
if (index > -1) {
|
||||
this.uname = this.list[index].uname;
|
||||
this.mobile = this.list[index].mobile;
|
||||
}
|
||||
},
|
||||
//提交新增编辑弹框
|
||||
submit() {
|
||||
let that = this;
|
||||
if (that.isSubmiting) return;
|
||||
if (!that.uname) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入团员姓名"
|
||||
});
|
||||
} else if (!/^1[3456789]\d{9}$/.test(that.mobile)) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
} else {
|
||||
that.isSubmiting = true;
|
||||
let url = '/h5/market/sylive/userTeam/add';
|
||||
let params = {};
|
||||
params['uname'] = that.uname;
|
||||
params['mobile'] = that.mobile;
|
||||
params['team_id'] = <?=$team_id?>;
|
||||
if (that.formIndex > -1) {
|
||||
url = '/h5/market/sylive/userTeam/edit';
|
||||
params['userId'] = this.list[that.formIndex].userId;
|
||||
}
|
||||
$.post(url, params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
that.isSubmiting = false;
|
||||
if (response.code == 200) {
|
||||
that.isShowForm = false;
|
||||
that.uname = '';
|
||||
that.mobile = '';
|
||||
that.loading = false;
|
||||
that.isDataEnd = false;
|
||||
that.isNoData = false;
|
||||
that.page = 1;
|
||||
that.list = [];
|
||||
that.getStaffList();
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
},
|
||||
//显示启用禁用确认框
|
||||
showAble(index) {
|
||||
this.ableIndex = index;
|
||||
this.isShowAble = true;
|
||||
},
|
||||
//启用禁用
|
||||
ableOpt() {
|
||||
//请求参数delOpt
|
||||
let that = this;
|
||||
let params = {};
|
||||
params['userId'] = that.list[that.ableIndex].userId;
|
||||
params['status'] = that.list[that.ableIndex].status == 1 ? 0 : 1;
|
||||
//执行接口
|
||||
$.post('/h5/market/sylive/userTeam/status', params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
if (response.code == 200) {
|
||||
that.list[that.ableIndex].status = that.list[that.ableIndex].status == 1 ? 0 : 1;
|
||||
that.isShowAble = false;
|
||||
}
|
||||
}, 'json');
|
||||
},
|
||||
//删除确认框
|
||||
showDel(index) {
|
||||
this.delIndex = index;
|
||||
this.isShowDel = true;
|
||||
},
|
||||
//删除
|
||||
delOpt() {
|
||||
let that = this;
|
||||
//请求参数
|
||||
let params = {};
|
||||
params['userId'] = that.list[that.delIndex].userId;
|
||||
params['status'] = -1;
|
||||
$.post('/h5/market/sylive/userTeam/status', params, function (response) {
|
||||
mDialog.msg({content: response.msg});
|
||||
if (response.code == 200) {
|
||||
that.isShowDel = false;
|
||||
that.isRefresh = true;
|
||||
that.loading = false;
|
||||
that.isDataEnd = false;
|
||||
that.isNoData = false;
|
||||
that.list = [];
|
||||
that.getStaffList();
|
||||
}
|
||||
}, 'json');
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<?= $this->load->view('h5/market/sylive/hidden_wx_share') ?>
|
||||
</body>
|
||||
@@ -36,7 +36,7 @@ class Goods extends BaseController
|
||||
$sort_order = $sort . ' ' . $order;
|
||||
}
|
||||
$where['status>'] = 0;
|
||||
$activityId && $where['a_id'] = $activityId;
|
||||
$activityId && $where['activityId'] = $activityId;
|
||||
$title && $where['title'] = $title;
|
||||
$count = $this->mdSyliveItems->count($where);
|
||||
$list = [];
|
||||
@@ -57,28 +57,30 @@ class Goods extends BaseController
|
||||
*/
|
||||
public function index_post()
|
||||
{
|
||||
$a_id = intval($this->input_param('a_id'));
|
||||
$activityId = intval($this->input_param('activityId'));
|
||||
$title = $this->input_param('title');
|
||||
$imgs = $this->input_param('imgs');
|
||||
$banner = $this->input_param('banner');
|
||||
$descrip = $this->input_param('descrip');
|
||||
$price = $this->input_param('price');
|
||||
$stock = $this->input_param('stock');
|
||||
$sort = $this->input_param('sort');
|
||||
if (!$a_id) {
|
||||
if (!$activityId) {
|
||||
$this->return_json('参数错误');
|
||||
}
|
||||
if (!$title) {
|
||||
$this->return_json('请输入商品标题');
|
||||
}
|
||||
$addDate = ['a_id' => $a_id, 'title' => $title, 'price' => $price, 'stock' => $stock, 'sort' => $sort
|
||||
$addDate = ['activityId' => $activityId, 'title' => $title, 'price' => $price, 'stock' => $stock, 'sort' => $sort
|
||||
, 'descrip' => $descrip, 'c_time' => time()];
|
||||
if ($imgs) {
|
||||
$setImgs = [];
|
||||
foreach ($imgs as $v) {
|
||||
$setImgs[] = $v['fileUrl'];
|
||||
$imgs = [];
|
||||
if ($banner) {
|
||||
$banner = [];
|
||||
foreach ($banner as $v) {
|
||||
$banner[] = $v['fileUrl'];
|
||||
}
|
||||
$addDate['imgs'] = $setImgs;
|
||||
$banner && $imgs['banner'] = $banner;
|
||||
}
|
||||
$imgs && $addDate['imgs'] = json_encode($imgs, JSON_UNESCAPED_UNICODE);
|
||||
$id = $this->mdSyliveItems->add($addDate);
|
||||
if (!$id) {
|
||||
$this->return_json('添加商品失败');
|
||||
|
||||
Reference in New Issue
Block a user