Compare commits
3 Commits
fea#sytopic
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 19c9abd500 | |||
| 02be3de115 | |||
| 7774cb3024 |
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notes:私域直播_用户表
|
* Notes:私域直播_用户表
|
||||||
@@ -49,4 +49,15 @@ class Market_sylive_user_model extends HD_Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkTopicIsAdmin($useId, $topicId)
|
||||||
|
{
|
||||||
|
$this->load->model('market/Market_sytopic_model', 'topic_model');
|
||||||
|
$userRow = $this->get(['userId' => $useId]);
|
||||||
|
$topicRow = $this->topic_model->get(['id' => $topicId]);
|
||||||
|
if ($userRow['topOrgId'] == $topicRow['organizationId']) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Market_sytopic_enroll_model extends HD_Model
|
||||||
|
{
|
||||||
|
private $table_name = 'lc_market_sytopic_enroll';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct($this->table_name, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
//专题报名
|
||||||
|
public function enroll($id, $topicUserId, $name, $mobile)
|
||||||
|
{
|
||||||
|
$this->load->model('market/Market_sytopic_user_model', 'topic_user_model');
|
||||||
|
$this->load->model('market/market_sytopic_module_option_model');
|
||||||
|
$optionRow = $this->market_sytopic_module_option_model->get(['id' => $id]);
|
||||||
|
$topicUser = $this->topic_user_model->get(['id' => $topicUserId]);
|
||||||
|
$row = $this->get(['status' => 0, 'moduleOptionId' => $id, 'userId' => $topicUser['userId']]);
|
||||||
|
if ($row) {
|
||||||
|
// $this->update(['name' => $name, 'mobile' => $mobile], ['id' => $row['id']]);
|
||||||
|
return ['code' => 0, 'msg' => '您的信息已收到,无需重复操作'];
|
||||||
|
}
|
||||||
|
$data = [
|
||||||
|
'topicUserId' => $topicUserId,
|
||||||
|
'userId' => $topicUser['userId'],
|
||||||
|
'channelId' => $topicUser['channelId'],
|
||||||
|
'name' => $name,
|
||||||
|
'mobile' => $mobile,
|
||||||
|
'enTime' => date('Y-m-d H:i:s'),
|
||||||
|
'createTime' => date('Y-m-d H:i:s'),
|
||||||
|
];
|
||||||
|
$optionRow['id'] && $data['moduleOptionId'] = $optionRow['id'];
|
||||||
|
$optionRow['topicId'] && $data['topicId'] = $optionRow['topicId'];
|
||||||
|
$optionRow['moduleId'] && $data['moduleId'] = $optionRow['moduleId'];
|
||||||
|
$res = $this->add($data);
|
||||||
|
if (!$res) {
|
||||||
|
return ['code' => 0, 'msg' => '提交失败'];
|
||||||
|
}
|
||||||
|
return ['code' => 1, 'msg' => '保存成功'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function statusCn()
|
||||||
|
{
|
||||||
|
$statusArray = [
|
||||||
|
0 => '待确认',
|
||||||
|
1 => '已确认',
|
||||||
|
2 => '无效单'
|
||||||
|
];
|
||||||
|
return $statusArray;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Market_sytopic_model extends HD_Model
|
||||||
|
{
|
||||||
|
private $table_name = 'lc_market_sytopic';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct($this->table_name, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Market_sytopic_module_model extends HD_Model
|
||||||
|
{
|
||||||
|
private $table_name = 'lc_market_sytopic_module';
|
||||||
|
|
||||||
|
// const TYPE_BANNER = 1; //banner图
|
||||||
|
const TYPE_DISCOUNT = 2; //特惠报名
|
||||||
|
const TYPE_SWIPER_BANNER = 3; //广告轮播图
|
||||||
|
const TYPE_GRID = 4; //网格排列表
|
||||||
|
const TYPE_HORIZONTAL = 5; // 横排
|
||||||
|
const TYPE_ARTICLE = 6; // 文章
|
||||||
|
|
||||||
|
const TYPE_ARRAY = [
|
||||||
|
// self::TYPE_BANNER => '主图',
|
||||||
|
self::TYPE_DISCOUNT => '轮播报名',
|
||||||
|
self::TYPE_GRID => '网格报名',
|
||||||
|
self::TYPE_HORIZONTAL => '横排报名',
|
||||||
|
self::TYPE_SWIPER_BANNER => '轮播图',
|
||||||
|
self::TYPE_ARTICLE => '富文本',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct($this->table_name, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTopicModelIds($topicId)
|
||||||
|
{
|
||||||
|
$where = ['topicId' => $topicId, 'status' => 0];
|
||||||
|
$modelList = $this->map('id','type',$where, 'sort desc,type asc', 1, 100, 'id,type');
|
||||||
|
return $modelList ?: [];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Market_sytopic_module_option_model extends HD_Model
|
||||||
|
{
|
||||||
|
private $table_name = 'lc_market_sytopic_module_option';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct($this->table_name, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTopicModelOptionsList($topicId)
|
||||||
|
{
|
||||||
|
$this->load->model('market/market_sytopic_module_model');
|
||||||
|
$modelList = $this->market_sytopic_module_model->getTopicModelIds($topicId);
|
||||||
|
$lists = [];
|
||||||
|
if ($modelList) {
|
||||||
|
$modelIdsStr = implode(',', array_keys($modelList));
|
||||||
|
$where = ['topicId' => $topicId, 'status' => 0, "moduleId in ({$modelIdsStr})" => null];
|
||||||
|
$modelOptionsList = $this->select($where, "FIELD (moduleId,{$modelIdsStr})", 1, 100);
|
||||||
|
foreach ($modelOptionsList as $item) {
|
||||||
|
$type = $modelList[$item['moduleId']];
|
||||||
|
$lists[$item['moduleId']]['type'] = $type;
|
||||||
|
$lists[$item['moduleId']]['lists'][] = $this->formItem($type, $item);;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $lists;
|
||||||
|
}
|
||||||
|
|
||||||
|
//格式化数据
|
||||||
|
private function formItem($type, $item)
|
||||||
|
{
|
||||||
|
$this->load->model('market/market_sytopic_module_model');
|
||||||
|
$this->load->model('market/market_sytopic_enroll_model');
|
||||||
|
$data = [
|
||||||
|
'id' => $item['id'],
|
||||||
|
'title' => $item['title'],
|
||||||
|
'subTitle' => $item['subTitle'],
|
||||||
|
'showBtn' => (bool)$item['showBtn'],
|
||||||
|
'btnText' => $item['btnText'],
|
||||||
|
'popUpType' => $item['popUpType'],
|
||||||
|
'targetUrl' => $item['targetUrl']
|
||||||
|
];
|
||||||
|
$data['banner'] = $item['banner'] ? build_qiniu_image_url($item['banner']) : '';
|
||||||
|
$otherImg = $item['otherImg'] ? json_decode($item['otherImg'], true) : [];
|
||||||
|
$otherImgSet = [];
|
||||||
|
if ($otherImg) {
|
||||||
|
foreach ($otherImg as $val) {
|
||||||
|
$otherImgSet[] = build_qiniu_image_url($val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['otherImg'] = $otherImgSet;
|
||||||
|
$jsonData = json_encode($item['jsondata'], true);
|
||||||
|
switch ($type) {
|
||||||
|
case Market_sytopic_module_model::TYPE_DISCOUNT: //特惠报名
|
||||||
|
$endTime = 0;
|
||||||
|
$showTime = false;
|
||||||
|
$enroll = true; //是否可报名
|
||||||
|
if ($item['enrollEndTime'] != '0000-00-00 00:00:00') {
|
||||||
|
$showTime = true;
|
||||||
|
if (strtotime($item['enrollEndTime']) - time() > 0) {
|
||||||
|
$endTime = strtotime($item['enrollEndTime']) - time();
|
||||||
|
} else {
|
||||||
|
$data['btnText'] = '已结束';
|
||||||
|
$enroll = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//限制报名总人数
|
||||||
|
$limitText = '';
|
||||||
|
if ($item['enrollLimit'] > 0 && $enroll) {
|
||||||
|
$enrollCount = $this->market_sytopic_enroll_model->count(['status' => 0, 'moduleOptionId' => $item['id']]);
|
||||||
|
$leftEnroll = $item['enrollLimit'] - $enrollCount;
|
||||||
|
if ($leftEnroll <= 0) {
|
||||||
|
$leftEnroll = 0;
|
||||||
|
$enroll = false;
|
||||||
|
}
|
||||||
|
$limitText = "(还剩{$leftEnroll}个名额)";
|
||||||
|
}
|
||||||
|
$data['endTime'] = $endTime;
|
||||||
|
$data['showTime'] = $showTime;
|
||||||
|
$data['limitText'] = $limitText;
|
||||||
|
$data['enroll'] = $enroll;
|
||||||
|
break;
|
||||||
|
case Market_sytopic_module_model::TYPE_ARTICLE: // 文章
|
||||||
|
$data['introduction'] = $item['introduction'];
|
||||||
|
$data['createTime'] = $item['createTime'];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$data['introduction'] = strip_tags($item['introduction']);
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Market_sytopic_user_model extends HD_Model
|
||||||
|
{
|
||||||
|
private $table_name = 'lc_market_sytopic_user';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct($this->table_name, 'default');
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断是否管理员
|
||||||
|
public function checkIsAdmin($id, $topicId)
|
||||||
|
{
|
||||||
|
$isAdmin = false;
|
||||||
|
$this->get(['id' => $id, 'topic_id' => $topicId]);
|
||||||
|
return $isAdmin;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Welcome extends CI_Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
echo "111";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,83 +1,150 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
require_once 'Common.php';
|
require_once 'Common.php';
|
||||||
|
|
||||||
class Biz extends Admin{
|
class Biz extends Admin
|
||||||
|
{
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct()
|
||||||
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
$this->load->model('market/Market_sytopic_enroll_model', 'sytopic_enroll_model');
|
||||||
}
|
}
|
||||||
|
|
||||||
//活动列表
|
//活动列表
|
||||||
public function index(){
|
public function index()
|
||||||
$user = $this->user_model->get(['userId'=>$this->session['userId']]);
|
{
|
||||||
|
$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'] == $user['organizationId'] ? 1 : 0;
|
||||||
|
//微信分享
|
||||||
|
$type = $this->input->get('type');
|
||||||
|
$wx_info = $this->share_info();
|
||||||
|
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||||
|
$this->data['type'] = $type;
|
||||||
|
$this->show_view('h5/market/sylive2/biz/index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function appLists()
|
||||||
|
{
|
||||||
|
$user = $this->user_model->get(['userId' => $this->session['userId']]);
|
||||||
$this->data['multi_org'] = $_SESSION[self::SESSION_KEY]['multi_org'] ? 1 : 0;
|
$this->data['multi_org'] = $_SESSION[self::SESSION_KEY]['multi_org'] ? 1 : 0;
|
||||||
$this->data['isBiz'] = $user['bizId'] == $user['organizationId'] ? 1 : 0;
|
$this->data['isBiz'] = $user['bizId'] == $user['organizationId'] ? 1 : 0;
|
||||||
//微信分享
|
//微信分享
|
||||||
$wx_info = $this->share_info();
|
$wx_info = $this->share_info();
|
||||||
$this->data['sign_package'] = $wx_info['sign_package'];
|
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||||
$this->show_view('h5/market/sylive2/biz/index');
|
$this->show_view('h5/market/sylive2/biz/app_lists');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function act_list(){
|
//活动列表
|
||||||
|
public function act_list()
|
||||||
|
{
|
||||||
$page = $this->input->get('page');
|
$page = $this->input->get('page');
|
||||||
$size = $this->input->get('size');
|
$size = $this->input->get('size');
|
||||||
!$page && $page = 1;
|
!$page && $page = 1;
|
||||||
!$size && $size = 20;
|
!$size && $size = 20;
|
||||||
|
$type = $this->input->get('type');
|
||||||
|
if ($type) {
|
||||||
|
return $this->topic_lists();
|
||||||
|
}
|
||||||
$where = [
|
$where = [
|
||||||
'userId' => $this->uid,
|
'userId' => $this->uid,
|
||||||
'status' => 0,
|
'status' => 0,
|
||||||
'activityId in (select activityId from lc_market_sylive_activity where status=0)' => null
|
'activityId in (select activityId from lc_market_sylive_activity where status=0)' => null
|
||||||
];
|
];
|
||||||
$total = $this->groups_user_model->count($where);
|
$total = $this->groups_user_model->count($where);
|
||||||
$rows = $this->groups_user_model->select($where,'activityId desc',$page,$size);
|
$rows = $this->groups_user_model->select($where, 'activityId desc', $page, $size);
|
||||||
$lists = [];
|
$lists = [];
|
||||||
if($rows){
|
if ($rows) {
|
||||||
$act_ids = implode(',',array_unique(array_column($rows,'activityId')));
|
$act_ids = implode(',', array_unique(array_column($rows, 'activityId')));
|
||||||
$act_rows = [];
|
$act_rows = [];
|
||||||
if($act_ids){
|
if ($act_ids) {
|
||||||
$where = [
|
$where = [
|
||||||
"activityId in ({$act_ids})" => null,
|
"activityId in ({$act_ids})" => null,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$act_ids && $act_rows = $this->market_sylive_activity_model->map('activityId','',$where,'','','','activityId,title,timeStart,timeEnd,jsondata');
|
$act_ids && $act_rows = $this->market_sylive_activity_model->map('activityId', '', $where, '', '', '', 'activityId,title,timeStart,timeEnd,jsondata');
|
||||||
foreach ($rows as $item) {
|
foreach ($rows as $item) {
|
||||||
$act = $act_rows[$item['activityId']] ? $act_rows[$item['activityId']][0] : [];
|
$act = $act_rows[$item['activityId']] ? $act_rows[$item['activityId']][0] : [];
|
||||||
if($act){
|
if ($act) {
|
||||||
$jsondata = json_decode($act['jsondata'],true);
|
$jsondata = json_decode($act['jsondata'], true);
|
||||||
$banner = $jsondata['banner'] ? build_qiniu_image_url($jsondata['banner']) : '';
|
$banner = $jsondata['banner'] ? build_qiniu_image_url($jsondata['banner']) : '';
|
||||||
$lists[] = [
|
$lists[] = [
|
||||||
'title' => $act['title'],
|
'title' => $act['title'],
|
||||||
'img' => $banner,
|
'img' => $banner,
|
||||||
'time' => date('Y-m-d H:i',strtotime($act['timeStart'])).'-'.date('Y-m-d H:i',strtotime($act['timeEnd'])),
|
'time' => date('Y-m-d H:i', strtotime($act['timeStart'])) . '-' . date('Y-m-d H:i', strtotime($act['timeEnd'])),
|
||||||
'url' => "/h5/market/sylive2/biz/userinfo?a_id={$item['activityId']}"
|
'url' => "/h5/market/sylive2/biz/userinfo?a_id={$item['activityId']}"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'list' => $lists,
|
'list' => $lists,
|
||||||
'total' => $total
|
'total' => $total
|
||||||
];
|
];
|
||||||
$this->show_json($data,200);
|
$this->show_json($data, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
//专题列表
|
||||||
|
public function topic_lists()
|
||||||
|
{
|
||||||
|
$page = $this->input->get('page');
|
||||||
|
$size = $this->input->get('size');
|
||||||
|
!$page && $page = 1;
|
||||||
|
!$size && $size = 20;
|
||||||
|
$user = $this->user_model->get(['userId' => $this->uid]);
|
||||||
|
$where = [
|
||||||
|
'status' => 0,
|
||||||
|
'organizationId' => $user['topOrgId'],
|
||||||
|
];
|
||||||
|
$total = $this->topic_model->count($where);
|
||||||
|
$lists = [];
|
||||||
|
if ($total) {
|
||||||
|
$rows = $this->topic_model->select($where, 'id desc', $page, $size);
|
||||||
|
foreach ($rows as $item) {
|
||||||
|
$banner = $item['banner'] ? build_qiniu_image_url($item['banner']) : '';
|
||||||
|
//浏览数
|
||||||
|
$userCount = $this->topic_user_model->count(['topicId' => $item['id'], 'bizId' => $user['bizId']]);
|
||||||
|
if ($userCount > 10000) {
|
||||||
|
$userCount = sprintf("%.2f", $userCount / 10000) . 'W';
|
||||||
|
}
|
||||||
|
//留资数
|
||||||
|
$lzCount = $this->sytopic_enroll_model->count(['topicId' => $item['id'], 'bizId' => $user['bizId'], 'status <> -1' => null]);
|
||||||
|
$lists[] = [
|
||||||
|
'title' => $item['title'],
|
||||||
|
'img' => $banner,
|
||||||
|
'time' => date('Y-m-d H:i', strtotime($item['timeStart'])) . '-' . date('Y-m-d H:i', strtotime($item['timeEnd'])),
|
||||||
|
'url' => "/h5/market/sytopic?skey=" . $this->myencryption->base64url_encode(Common::SIGN_TOP_KEY . '=' . $item['id']),
|
||||||
|
'userCount' => $userCount,
|
||||||
|
'lzCount' => $lzCount,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data = [
|
||||||
|
'list' => $lists,
|
||||||
|
'total' => $total
|
||||||
|
];
|
||||||
|
$this->show_json($data, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取微信用户信息
|
//获取微信用户信息
|
||||||
public function userinfo(){
|
public function userinfo()
|
||||||
if(!$_SESSION[self::SESSION_KEY]['all_info']){
|
{
|
||||||
$ret = $this->set_auth('',1);
|
if (!$_SESSION[self::SESSION_KEY]['all_info']) {
|
||||||
if($ret){
|
$ret = $this->set_auth('', 1);
|
||||||
|
if ($ret) {
|
||||||
$update = [
|
$update = [
|
||||||
"sex" => $ret['sex'] ? 1 : 0,
|
"sex" => $ret['sex'] ? 1 : 0,
|
||||||
];
|
];
|
||||||
$ret['nickname'] && $update['nickname'] = strval($ret['nickname']);
|
$ret['nickname'] && $update['nickname'] = strval($ret['nickname']);
|
||||||
$ret['headimgurl'] && $update['headimg'] = strval($ret['headimgurl']);
|
$ret['headimgurl'] && $update['headimg'] = strval($ret['headimgurl']);
|
||||||
$ret['unionid'] && $update['unionid'] = $ret['unionid'];
|
$ret['unionid'] && $update['unionid'] = $ret['unionid'];
|
||||||
$this->user_model->update($update,['userId'=>$this->uid,'openid'=>$ret['openid']]);
|
$this->user_model->update($update, ['userId' => $this->uid, 'openid' => $ret['openid']]);
|
||||||
}
|
}
|
||||||
$_SESSION[self::SESSION_KEY]['all_info'] =1;
|
$_SESSION[self::SESSION_KEY]['all_info'] = 1;
|
||||||
}
|
}
|
||||||
$a_id = $this->input->get('a_id');
|
$a_id = $this->input->get('a_id');
|
||||||
$my_url = http_host_com('home')."/h5/market/sylive2/stic?a_id={$a_id}";
|
$my_url = http_host_com('home') . "/h5/market/sylive2/stic?a_id={$a_id}";
|
||||||
redirect($my_url);
|
redirect($my_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('APPPATH') OR exit('No direct script access allowed');
|
defined('APPPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User: lcc
|
* User: lcc
|
||||||
* Date: 2022/09/18
|
* Date: 2022/09/18
|
||||||
* Time: 17:13
|
* Time: 17:13
|
||||||
*/
|
*/
|
||||||
abstract class Common extends CI_Controller{
|
abstract class Common extends CI_Controller
|
||||||
|
{
|
||||||
|
|
||||||
const SESSION_KEY = 'market_sylive_session';
|
const SESSION_KEY = 'market_sylive_session';
|
||||||
|
const SIGN_TOP_KEY = 'topic_id';
|
||||||
|
|
||||||
protected $data;
|
protected $data;
|
||||||
protected $white_login_method=[]; //授权白名单
|
protected $white_login_method = []; //授权白名单
|
||||||
protected $uid;
|
protected $uid;
|
||||||
protected $mobile;
|
protected $mobile;
|
||||||
protected $act_uid;
|
protected $act_uid;
|
||||||
@@ -19,13 +22,16 @@ abstract class Common extends CI_Controller{
|
|||||||
protected $secret = "market_sylive_h5_test";
|
protected $secret = "market_sylive_h5_test";
|
||||||
protected $secretkey = '7a23vx9257';
|
protected $secretkey = '7a23vx9257';
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct()
|
||||||
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->load->model('market/market_sylive_user_model', 'user_model');
|
$this->load->model('market/market_sylive_user_model', 'user_model');
|
||||||
$this->load->model('market/market_sylive_activity_user_model', 'act_user_model');
|
$this->load->model('market/market_sylive_activity_user_model', 'act_user_model');
|
||||||
$this->load->model('market/market_sylive_groups_model', 'groups_model');
|
$this->load->model('market/market_sylive_groups_model', 'groups_model');
|
||||||
$this->load->model('market/market_sylive_groups_user_model', 'groups_user_model');
|
$this->load->model('market/market_sylive_groups_user_model', 'groups_user_model');
|
||||||
$this->load->model('market/market_sylive_activity_model');
|
$this->load->model('market/market_sylive_activity_model');
|
||||||
|
$this->load->model('market/Market_sytopic_model', 'topic_model');
|
||||||
|
$this->load->model('market/Market_sytopic_user_model', 'topic_user_model');
|
||||||
|
|
||||||
$this->load->library('hd_exception');
|
$this->load->library('hd_exception');
|
||||||
$this->load->library('MyEncryption');
|
$this->load->library('MyEncryption');
|
||||||
@@ -40,8 +46,9 @@ abstract class Common extends CI_Controller{
|
|||||||
/**
|
/**
|
||||||
* @param $view
|
* @param $view
|
||||||
*/
|
*/
|
||||||
protected function show_view($view){
|
protected function show_view($view)
|
||||||
$this->load->view('h5/market/sylive2/header',$this->data);
|
{
|
||||||
|
$this->load->view('h5/market/sylive2/header', $this->data);
|
||||||
$this->load->view($view);
|
$this->load->view($view);
|
||||||
$this->load->view('h5/market/sylive2/footer');
|
$this->load->view('h5/market/sylive2/footer');
|
||||||
}
|
}
|
||||||
@@ -54,7 +61,7 @@ abstract class Common extends CI_Controller{
|
|||||||
*/
|
*/
|
||||||
protected function show_json($data, $code = 200, $msg = 'success', $url = '')
|
protected function show_json($data, $code = 200, $msg = 'success', $url = '')
|
||||||
{
|
{
|
||||||
if(!isset($data['code'])){
|
if (!isset($data['code'])) {
|
||||||
$data = array('data' => $data, 'code' => $code, 'msg' => $msg, 'url' => $url);
|
$data = array('data' => $data, 'code' => $code, 'msg' => $msg, 'url' => $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,13 +74,14 @@ abstract class Common extends CI_Controller{
|
|||||||
* @return void
|
* @return void
|
||||||
* @throws Hd_exception
|
* @throws Hd_exception
|
||||||
*/
|
*/
|
||||||
protected function set_auth($url='',$auth=0){
|
protected function set_auth($url = '', $auth = 0)
|
||||||
|
{
|
||||||
$this->load->helper('url');
|
$this->load->helper('url');
|
||||||
$this->load->config('wechat');
|
$this->load->config('wechat');
|
||||||
$config = $this->config->item('hdy');
|
$config = $this->config->item('hdy');
|
||||||
$code = $this->input->get('code');
|
$code = $this->input->get('code');
|
||||||
!$url && $url = http_host_com('home').$_SERVER['REQUEST_URI'];
|
!$url && $url = http_host_com('home') . $_SERVER['REQUEST_URI'];
|
||||||
$auth && $url = $_SERVER['QUERY_STRING'] ? $url."&auth={$auth}" : $url."?auth={$auth}";
|
$auth && $url = $_SERVER['QUERY_STRING'] ? $url . "&auth={$auth}" : $url . "?auth={$auth}";
|
||||||
if ($code) {//授权码获取微信信息
|
if ($code) {//授权码获取微信信息
|
||||||
$auth_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$config['appid']}&secret={$config['appSecret']}&code={$code}&grant_type=authorization_code";
|
$auth_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$config['appid']}&secret={$config['appSecret']}&code={$code}&grant_type=authorization_code";
|
||||||
$res = file_get_contents($auth_url);
|
$res = file_get_contents($auth_url);
|
||||||
@@ -81,12 +89,12 @@ abstract class Common extends CI_Controller{
|
|||||||
$access_token = $ret['access_token'];
|
$access_token = $ret['access_token'];
|
||||||
$openid = $ret['openid'];
|
$openid = $ret['openid'];
|
||||||
$unionid = $ret['unionid'];
|
$unionid = $ret['unionid'];
|
||||||
if($this->input->get('auth') && $access_token){
|
if ($this->input->get('auth') && $access_token) {
|
||||||
$u_info_url = "https://api.weixin.qq.com/sns/userinfo?access_token={$access_token}&openid={$openid}&lang=zh_CN";
|
$u_info_url = "https://api.weixin.qq.com/sns/userinfo?access_token={$access_token}&openid={$openid}&lang=zh_CN";
|
||||||
$u_ret = file_get_contents($u_info_url);
|
$u_ret = file_get_contents($u_info_url);
|
||||||
$ret = json_decode($u_ret,true);
|
$ret = json_decode($u_ret, true);
|
||||||
}
|
}
|
||||||
if(!$openid){
|
if (!$openid) {
|
||||||
debug_log("[error]# " . $res, __FUNCTION__, $this->log_dir);
|
debug_log("[error]# " . $res, __FUNCTION__, $this->log_dir);
|
||||||
throw new Hd_exception('获取用户信息失败', 400);
|
throw new Hd_exception('获取用户信息失败', 400);
|
||||||
}
|
}
|
||||||
@@ -95,32 +103,49 @@ abstract class Common extends CI_Controller{
|
|||||||
$redirect_uri = urlencode($url);
|
$redirect_uri = urlencode($url);
|
||||||
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$config['appid']}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect&forcePopup=true";
|
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$config['appid']}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect&forcePopup=true";
|
||||||
redirect($auth_url);
|
redirect($auth_url);
|
||||||
} else{//静默授权获取用户openid
|
} else {//静默授权获取用户openid
|
||||||
$redirect_uri = urlencode($url);
|
$redirect_uri = urlencode($url);
|
||||||
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$config['appid']}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
|
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$config['appid']}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
|
||||||
redirect($auth_url);
|
redirect($auth_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//微信分享信息
|
//微信分享信息
|
||||||
protected function share_info($act_row=[]){
|
protected function share_info($act_row = [], $topic_row = [])
|
||||||
$a_id = $act_row['activityId'];
|
{
|
||||||
$share_skey = "a_id=" . $a_id . "&cf_uid=" . $this->uid;
|
|
||||||
$this->load->library('Jssdk');
|
$this->load->library('Jssdk');
|
||||||
$jssdk = new Jssdk('liche');
|
$jssdk = new Jssdk('liche');
|
||||||
$sign_package = $jssdk->getSignPackage();
|
$sign_package = $jssdk->getSignPackage();
|
||||||
$share = [];
|
$share = [];
|
||||||
if($act_row){
|
$a_id = $act_row['activityId'];
|
||||||
//微信分享
|
if ($a_id) {
|
||||||
$share_url = http_host_com('home') . "/h5/market/sylive2/act?skey=" . $this->myencryption->base64url_encode($share_skey);
|
$share_skey = "a_id=" . $a_id . "&cf_uid=" . $this->uid;
|
||||||
$shareTitle = $act_row['shareTitle'] ? json_decode($act_row['shareTitle'],true) : [];
|
}
|
||||||
|
$topic_id = $topic_row['id'];
|
||||||
|
if ($topic_id) {
|
||||||
|
$share_skey = self::SIGN_TOP_KEY . "=" . $topic_id . "&cf_uid=" . $this->uid;
|
||||||
|
}
|
||||||
|
if ($act_row) {
|
||||||
|
$shareTitle = [];
|
||||||
|
$share_url = $sharePhoto = '';
|
||||||
|
if ($a_id) {
|
||||||
|
$share_url = http_host_com('home') . "/h5/market/sylive2/act?skey=" . $this->myencryption->base64url_encode($share_skey);
|
||||||
|
$shareTitle = $act_row['shareTitle'] ? json_decode($act_row['shareTitle'], true) : [];
|
||||||
|
$sharePhoto = $act_row['sharePhoto'] ? build_qiniu_image_url($act_row['sharePhoto']) : '';
|
||||||
|
}
|
||||||
|
if ($topic_id) {
|
||||||
|
$share_url = http_host_com('home') . "/h5/market/sytopic?skey=" . $this->myencryption->base64url_encode($share_skey);
|
||||||
|
$shareTitle = $topic_row['shareTitle'] ? json_decode($topic_row['shareTitle'], true) : [];
|
||||||
|
$sharePhoto = $topic_row['sharePhoto'] ? build_qiniu_image_url($topic_row['sharePhoto']) : '';
|
||||||
|
}
|
||||||
$share = array(
|
$share = array(
|
||||||
'title' => $act_row['title'],
|
'title' => $act_row['title'],
|
||||||
"img" => $act_row['sharePhoto'] ? build_qiniu_image_url($act_row['sharePhoto']) : '',
|
"img" => $sharePhoto,
|
||||||
"desc" => $shareTitle[array_rand($shareTitle)],
|
"desc" => $shareTitle[array_rand($shareTitle)],
|
||||||
"url" => $share_url
|
"url" => $share_url
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return ['sign_package' => $sign_package ,'share' => $share];
|
return ['sign_package' => $sign_package, 'share' => $share];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,13 +162,16 @@ abstract class Common extends CI_Controller{
|
|||||||
* @return array|false
|
* @return array|false
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
protected function unorder($trade_no,$price,$openid,$body,$notify_url,$expire_time,$other_data=[]){
|
protected function unorder($trade_no, $price, $openid, $body, $notify_url, $expire_time, $other_data = [])
|
||||||
if(!$body){return false;}
|
{
|
||||||
require_once APPPATH."../api/third_party/WXpay/WxPay.Api.php";
|
if (!$body) {
|
||||||
if($other_data['pay_config'] && file_exists($other_data['pay_config'])){
|
return false;
|
||||||
|
}
|
||||||
|
require_once APPPATH . "../api/third_party/WXpay/WxPay.Api.php";
|
||||||
|
if ($other_data['pay_config'] && file_exists($other_data['pay_config'])) {
|
||||||
require_once $other_data['pay_config'];
|
require_once $other_data['pay_config'];
|
||||||
}else{
|
} else {
|
||||||
require_once APPPATH."../api/third_party/WXconfig/hdy_WxPay.Config.php";
|
require_once APPPATH . "../api/third_party/WXconfig/hdy_WxPay.Config.php";
|
||||||
}
|
}
|
||||||
$config = new WxPayConfig();
|
$config = new WxPayConfig();
|
||||||
$wxpay = new WxPayUnifiedOrder();
|
$wxpay = new WxPayUnifiedOrder();
|
||||||
@@ -154,164 +182,266 @@ abstract class Common extends CI_Controller{
|
|||||||
$wxpay->SetOut_trade_no($trade_no); //订单号
|
$wxpay->SetOut_trade_no($trade_no); //订单号
|
||||||
$wxpay->SetTotal_fee($price * 100); //支付价格
|
$wxpay->SetTotal_fee($price * 100); //支付价格
|
||||||
$wxpay->SetTime_start(date("YmdHis")); //交易起始时间
|
$wxpay->SetTime_start(date("YmdHis")); //交易起始时间
|
||||||
$wxpay->SetTime_expire(date('YmdHis',$expire_time)); //交易结束时间
|
$wxpay->SetTime_expire(date('YmdHis', $expire_time)); //交易结束时间
|
||||||
$wxpay->SetTrade_type("JSAPI"); //设置交易类型
|
$wxpay->SetTrade_type("JSAPI"); //设置交易类型
|
||||||
$wxpay->SetOpenid($openid); //openid
|
$wxpay->SetOpenid($openid); //openid
|
||||||
$return = WxPayApi::unifiedOrder($config, $wxpay); //统一支付
|
$return = WxPayApi::unifiedOrder($config, $wxpay); //统一支付
|
||||||
if($return['result_code'] == 'SUCCESS') {
|
if ($return['result_code'] == 'SUCCESS') {
|
||||||
$wxpay_api = new WxPayJsApiPay();
|
$wxpay_api = new WxPayJsApiPay();
|
||||||
$jsApiParameters = WxPayApi::GetJsApiParameters($return, $config, $wxpay_api);
|
$jsApiParameters = WxPayApi::GetJsApiParameters($return, $config, $wxpay_api);
|
||||||
$jsApiParameters = json_decode($jsApiParameters, true);
|
$jsApiParameters = json_decode($jsApiParameters, true);
|
||||||
return ['code'=>1,'data'=>$jsApiParameters,'msg'=>'下单成功'];
|
return ['code' => 1, 'data' => $jsApiParameters, 'msg' => '下单成功'];
|
||||||
}else{
|
} else {
|
||||||
$msg = $return['return_msg'] ? $return['return_msg'].$return['err_code_des'] : $return['return_msg'];
|
$msg = $return['return_msg'] ? $return['return_msg'] . $return['err_code_des'] : $return['return_msg'];
|
||||||
return ['code'=>0,'data'=>[],'msg'=>$msg];
|
return ['code' => 0, 'data' => [], 'msg' => $msg];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Admin extends Common{
|
class Admin extends Common
|
||||||
|
{
|
||||||
const WX_SESSION = "market_wx_info";
|
const WX_SESSION = "market_wx_info";
|
||||||
public function __construct(){
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
//print_r($this->session);
|
//print_r($this->session);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _remap($method){
|
public function _remap($method)
|
||||||
try{
|
{
|
||||||
|
try {
|
||||||
$this->session = $_SESSION[self::SESSION_KEY];
|
$this->session = $_SESSION[self::SESSION_KEY];
|
||||||
$this->mobile = $this->session['mobile'];
|
$this->mobile = $this->session['mobile'];
|
||||||
$_SESSION[self::SESSION_KEY]['act_uid'] = '';
|
$_SESSION[self::SESSION_KEY]['act_uid'] = '';
|
||||||
if(!in_array($method,$this->white_login_method) && !$_SESSION[self::SESSION_KEY]['mobile'] && !$this->uid){
|
if (!in_array($method, $this->white_login_method) && !$_SESSION[self::SESSION_KEY]['mobile'] && !$this->uid) {
|
||||||
$ret = $this->set_auth();
|
$ret = $this->set_auth();
|
||||||
$openid = $ret['openid'];
|
$openid = $ret['openid'];
|
||||||
$row_wechat = $this->user_model->get(['openid' => $openid,'status'=>0,'organizationId>'=>0]);
|
$row_wechat = $this->user_model->get(['openid' => $openid, 'status' => 0, 'organizationId>' => 0]);
|
||||||
if(!$row_wechat){
|
if (!$row_wechat) {
|
||||||
$_SESSION[self::WX_SESSION] = $ret;
|
$_SESSION[self::WX_SESSION] = $ret;
|
||||||
header('Location:/h5/market/sylive2/login');exit;
|
header('Location:/h5/market/sylive2/login');
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
//更新未绑定用户openid
|
//更新未绑定用户openid
|
||||||
$row_wechat['mobile'] && $this->user_model->update(['openid'=>$openid],['mobile'=>$row_wechat['mobile'],'status'=>0]);
|
$row_wechat['mobile'] && $this->user_model->update(['openid' => $openid], ['mobile' => $row_wechat['mobile'], 'status' => 0]);
|
||||||
$_SESSION[self::SESSION_KEY]['mobile'] = $row_wechat['mobile'];
|
$_SESSION[self::SESSION_KEY]['mobile'] = $row_wechat['mobile'];
|
||||||
$org_url = http_host_com('home')."/h5/market/sylive2";
|
$org_url = http_host_com('home') . "/h5/market/sylive2";
|
||||||
redirect($org_url);
|
redirect($org_url);
|
||||||
}
|
}
|
||||||
return $this->$method();
|
return $this->$method();
|
||||||
} catch(Hd_exception $e){//处理异常
|
} catch (Hd_exception $e) {//处理异常
|
||||||
$msg = $e->getMessage();
|
$msg = $e->getMessage();
|
||||||
$data = array('heading' => 'Warning', 'message' => $msg);
|
$data = array('heading' => 'Warning', 'message' => $msg);
|
||||||
return $this->load->view('errors/html/error_404',$data);
|
return $this->load->view('errors/html/error_404', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Wx extends Common{
|
class Wx extends Common
|
||||||
public function __construct(){
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _remap($method){
|
public function _remap($method)
|
||||||
try{
|
{
|
||||||
if(!$this->act_uid){
|
try {
|
||||||
|
if (!$this->act_uid) {
|
||||||
$this->session = $this->uid = '';
|
$this->session = $this->uid = '';
|
||||||
}
|
}
|
||||||
if(!in_array($method,$this->white_login_method) && !$this->uid){
|
$skey = $this->input->get('skey');
|
||||||
|
$param = $this->myencryption->base64url_decode($skey);
|
||||||
|
if (!in_array($method, $this->white_login_method) && !$this->uid) {
|
||||||
$ret = $this->set_auth();
|
$ret = $this->set_auth();
|
||||||
$openid = $ret['openid'];
|
if (!$ret['openid']) {
|
||||||
if(!$openid){
|
echo("<script>setTimeout('window.location.reload()', 1);</script>");
|
||||||
echo ("<script>setTimeout('window.location.reload()', 1);</script>");exit;
|
exit;
|
||||||
}
|
}
|
||||||
$skey = $this->input->get('skey');
|
if ($param['a_id']) {
|
||||||
$param = $this->myencryption->base64url_decode($skey);
|
$this->initUserByActivity($param, $ret); //私域直播用户初始化
|
||||||
//找管理员角色
|
} elseif ($param[self::SIGN_TOP_KEY]) {
|
||||||
$where = [
|
$this->initUserByTopic($param, $ret); //专题活动用户初始化
|
||||||
'activityId' => $param['a_id'],
|
|
||||||
'status' => 0,
|
|
||||||
"userId in (select `userId` from lc_market_sylive_user where openid='{$openid}')" => null
|
|
||||||
];
|
|
||||||
$row_wechat = $this->groups_user_model->get($where);
|
|
||||||
if(!$row_wechat){
|
|
||||||
$row_wechat = $this->user_model->get(['status'=>0,'openid'=>$openid]);//普通用户角色
|
|
||||||
}
|
}
|
||||||
if(!$row_wechat){ //创建用户
|
} else {
|
||||||
$add = array(
|
if ($param['a_id']) { //私域直播
|
||||||
"openid" => $openid,
|
//更新pid
|
||||||
"sex" => $ret['sex'] ? 1 : 0,
|
$act_user = $this->act_user_model->get(['activityId' => $param['a_id'], 'userId' => $this->uid]);
|
||||||
"createTime" => date('Y-m-d H:i:s')
|
if ($param['cf_uid']) {
|
||||||
);
|
$p_act_user = $this->act_user_model->get(['userId' => $param['cf_uid'], 'activityId' => $param['a_id']], 'userId,channelId');
|
||||||
$ret['nickname'] && $add['nickname'] = strval($ret['nickname']);
|
$update_ac_user['pid'] = $p_act_user['userId'];
|
||||||
$ret['headimgurl'] && $add['headimg'] = strval($ret['headimgurl']);
|
|
||||||
$ret['unionid'] && $add['unionid'] = $ret['unionid'];
|
|
||||||
$this->uid = $this->user_model->add($add);
|
|
||||||
if (!$this->uid) {
|
|
||||||
debug_log("[error]# " . $this->mdWeixinUsers->db->last_query(), __FUNCTION__, $this->log_dir);
|
|
||||||
}
|
}
|
||||||
}else{
|
$update_ac_user && $this->act_user_model->update($update_ac_user, ['id' => $act_user['id']]);
|
||||||
$this->uid = $row_wechat['userId'];
|
|
||||||
}
|
}
|
||||||
//判断是否有绑定马甲
|
|
||||||
$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 && !$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']]);//普通用户角色
|
|
||||||
$this->uid = $row_wechat['userId'];
|
|
||||||
}
|
|
||||||
$act_user = $this->act_user_model->get(['activityId'=>$param['a_id'],'userId'=>$this->uid]);
|
|
||||||
if(!$act_user && $param['a_id']){
|
|
||||||
$act_data = [
|
|
||||||
'activityId' => $param['a_id'],
|
|
||||||
'userId' => $this->uid,
|
|
||||||
"createTime" => date('Y-m-d H:i:s')
|
|
||||||
];
|
|
||||||
$row_wechat['bizId'] && $act_data['bizId'] = $row_wechat['bizId'];
|
|
||||||
$row_wechat['groupsId'] && $act_data['groupsId'] = $row_wechat['groupsId'];
|
|
||||||
$row_wechat['levelId1'] && $act_data['levelId1'] = $row_wechat['levelId1'];
|
|
||||||
$row_wechat['levelId2'] && $act_data['levelId2'] = $row_wechat['levelId2'];
|
|
||||||
$row_wechat['levelId3'] && $act_data['levelId3'] = $row_wechat['levelId3'];
|
|
||||||
if($param['cf_uid']){
|
|
||||||
$p_act_user = $this->act_user_model->get(['userId'=>$param['cf_uid'],'activityId'=>$param['a_id']],'userId,channelId');
|
|
||||||
if($p_act_user['channelId']){
|
|
||||||
$act_data['channelId'] = $p_act_user['channelId'];
|
|
||||||
}else{
|
|
||||||
$p_act_user['groupsId'] && $act_data['channelId'] = $p_act_user['userId'];
|
|
||||||
}
|
|
||||||
$act_data['pid'] = $p_act_user['userId'];
|
|
||||||
}
|
|
||||||
$row_wechat['groupsId'] && $act_data['channelId'] = $this->uid;//管理员自己归属到自己
|
|
||||||
$act_user['id'] = $this->act_user_model->add($act_data);
|
|
||||||
}else{
|
|
||||||
//更新分组信息
|
|
||||||
$update_ac_user = [];
|
|
||||||
if($act_user['bizId']!=$row_wechat['bizId']){
|
|
||||||
$update_ac_user['bizId'] = $row_wechat['bizId'];
|
|
||||||
}
|
|
||||||
if($act_user['groupsId']!=$row_wechat['groupsId']){
|
|
||||||
$update_ac_user['groupsId'] = $row_wechat['groupsId'];
|
|
||||||
}
|
|
||||||
if($act_user['levelId1']!=$row_wechat['levelId1']){
|
|
||||||
$update_ac_user['levelId1'] = $row_wechat['levelId1'];
|
|
||||||
}
|
|
||||||
if($act_user['levelId2']!=$row_wechat['levelId2']){
|
|
||||||
$update_ac_user['levelId2'] = $row_wechat['levelId2'];
|
|
||||||
}
|
|
||||||
if($act_user['levelId3']!=$row_wechat['levelId3']){
|
|
||||||
$update_ac_user['levelId3'] = $row_wechat['levelId3'];
|
|
||||||
}
|
|
||||||
$update_ac_user && $this->act_user_model->update($update_ac_user,['id'=>$act_user['id']]);
|
|
||||||
}
|
|
||||||
$_SESSION[self::SESSION_KEY]['userId'] = $this->uid;
|
|
||||||
$_SESSION[self::SESSION_KEY]['act_uid'] = $act_user['id'];
|
|
||||||
echo ("<script>setTimeout('window.location.reload()', 1);</script>");exit;
|
|
||||||
}
|
}
|
||||||
return $this->$method();
|
return $this->$method();
|
||||||
} catch(Hd_exception $e){//处理异常
|
} catch (Hd_exception $e) {//处理异常
|
||||||
$msg = $e->getMessage();
|
$msg = $e->getMessage();
|
||||||
$data = array('heading' => 'Warning', 'message' => $msg);
|
$data = array('heading' => 'Warning', 'message' => $msg);
|
||||||
return $this->load->view('errors/html/error_404',$data);
|
return $this->load->view('errors/html/error_404', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//私域直播用户初始化
|
||||||
|
private function initUserByActivity($param, $wxInfo)
|
||||||
|
{
|
||||||
|
$openid = $wxInfo['openid'];
|
||||||
|
//找管理员角色
|
||||||
|
$where = [
|
||||||
|
'activityId' => $param['a_id'],
|
||||||
|
'status' => 0,
|
||||||
|
"userId in (select `userId` from lc_market_sylive_user where openid='{$openid}')" => null
|
||||||
|
];
|
||||||
|
$row_wechat = $this->groups_user_model->get($where);
|
||||||
|
if (!$row_wechat) {
|
||||||
|
$row_wechat = $this->user_model->get(['status' => 0, 'openid' => $openid]);//普通用户角色
|
||||||
|
}
|
||||||
|
if (!$row_wechat) { //创建用户
|
||||||
|
$add = array(
|
||||||
|
"openid" => $openid,
|
||||||
|
"sex" => $wxInfo['sex'] ? 1 : 0,
|
||||||
|
"createTime" => date('Y-m-d H:i:s')
|
||||||
|
);
|
||||||
|
$wxInfo['nickname'] && $add['nickname'] = strval($wxInfo['nickname']);
|
||||||
|
$wxInfo['headimgurl'] && $add['headimg'] = strval($wxInfo['headimgurl']);
|
||||||
|
$wxInfo['unionid'] && $add['unionid'] = $wxInfo['unionid'];
|
||||||
|
$this->uid = $this->user_model->add($add);
|
||||||
|
if (!$this->uid) {
|
||||||
|
debug_log("[error]# " . $this->mdWeixinUsers->db->last_query(), __FUNCTION__, $this->log_dir);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->uid = $row_wechat['userId'];
|
||||||
|
}
|
||||||
|
//判断是否有绑定马甲
|
||||||
|
$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 && !$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']]);//普通用户角色
|
||||||
|
$this->uid = $row_wechat['userId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$act_user = $this->act_user_model->get(['activityId' => $param['a_id'], 'userId' => $this->uid]);
|
||||||
|
if (!$act_user && $param['a_id']) {
|
||||||
|
$act_data = [
|
||||||
|
'activityId' => $param['a_id'],
|
||||||
|
'userId' => $this->uid,
|
||||||
|
'pid' => 0,
|
||||||
|
"createTime" => date('Y-m-d H:i:s')
|
||||||
|
];
|
||||||
|
$row_wechat['bizId'] && $act_data['bizId'] = $row_wechat['bizId'];
|
||||||
|
$row_wechat['groupsId'] && $act_data['groupsId'] = $row_wechat['groupsId'];
|
||||||
|
$row_wechat['levelId1'] && $act_data['levelId1'] = $row_wechat['levelId1'];
|
||||||
|
$row_wechat['levelId2'] && $act_data['levelId2'] = $row_wechat['levelId2'];
|
||||||
|
$row_wechat['levelId3'] && $act_data['levelId3'] = $row_wechat['levelId3'];
|
||||||
|
if ($param['cf_uid']) {
|
||||||
|
$p_act_user = $this->act_user_model->get(['userId' => $param['cf_uid'], 'activityId' => $param['a_id']], 'userId,channelId');
|
||||||
|
if ($p_act_user['channelId']) {
|
||||||
|
$act_data['channelId'] = $p_act_user['channelId'];
|
||||||
|
} else {
|
||||||
|
$p_act_user['groupsId'] && $act_data['channelId'] = $p_act_user['userId'];
|
||||||
|
}
|
||||||
|
$act_data['pid'] = $p_act_user['userId'] ? $p_act_user['userId'] : 0;
|
||||||
|
}
|
||||||
|
$row_wechat['groupsId'] && $act_data['channelId'] = $this->uid;//管理员自己归属到自己
|
||||||
|
$act_user['id'] = $this->act_user_model->add($act_data);
|
||||||
|
} else {
|
||||||
|
//更新分组信息
|
||||||
|
$update_ac_user = [];
|
||||||
|
if ($act_user['bizId'] != $row_wechat['bizId']) {
|
||||||
|
$update_ac_user['bizId'] = $row_wechat['bizId'];
|
||||||
|
}
|
||||||
|
if ($act_user['groupsId'] != $row_wechat['groupsId']) {
|
||||||
|
$update_ac_user['groupsId'] = $row_wechat['groupsId'];
|
||||||
|
}
|
||||||
|
if ($act_user['levelId1'] != $row_wechat['levelId1']) {
|
||||||
|
$update_ac_user['levelId1'] = $row_wechat['levelId1'];
|
||||||
|
}
|
||||||
|
if ($act_user['levelId2'] != $row_wechat['levelId2']) {
|
||||||
|
$update_ac_user['levelId2'] = $row_wechat['levelId2'];
|
||||||
|
}
|
||||||
|
if ($act_user['levelId3'] != $row_wechat['levelId3']) {
|
||||||
|
$update_ac_user['levelId3'] = $row_wechat['levelId3'];
|
||||||
|
}
|
||||||
|
$update_ac_user && $this->act_user_model->update($update_ac_user, ['id' => $act_user['id']]);
|
||||||
|
}
|
||||||
|
$_SESSION[self::SESSION_KEY]['userId'] = $this->uid;
|
||||||
|
$_SESSION[self::SESSION_KEY]['act_uid'] = $act_user['id'];
|
||||||
|
echo("<script>setTimeout('window.location.reload()', 1);</script>");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
//专题用户初始化
|
||||||
|
private function initUserByTopic($param, $wxInfo)
|
||||||
|
{
|
||||||
|
$topic_id = $param[Common::SIGN_TOP_KEY];
|
||||||
|
$openid = $wxInfo['openid'];
|
||||||
|
//找管理员角色
|
||||||
|
$where = [
|
||||||
|
'openid' => $openid,
|
||||||
|
'status' => 0,
|
||||||
|
"topOrgId in (select organizationId from lc_market_sytopic where id={$topic_id})" => null
|
||||||
|
];
|
||||||
|
$row_wechat = $this->user_model->get($where);
|
||||||
|
if (!$row_wechat) {
|
||||||
|
$row_wechat = $this->user_model->get(['status' => 0, 'openid' => $openid]);//普通用户角色
|
||||||
|
}
|
||||||
|
if (!$row_wechat) { //创建普通用户
|
||||||
|
$add = array(
|
||||||
|
"openid" => $openid,
|
||||||
|
"sex" => $wxInfo['sex'] ? 1 : 0,
|
||||||
|
"createTime" => date('Y-m-d H:i:s')
|
||||||
|
);
|
||||||
|
$wxInfo['nickname'] && $add['nickname'] = strval($wxInfo['nickname']);
|
||||||
|
$wxInfo['headimgurl'] && $add['headimg'] = strval($wxInfo['headimgurl']);
|
||||||
|
$wxInfo['unionid'] && $add['unionid'] = $wxInfo['unionid'];
|
||||||
|
$this->uid = $this->user_model->add($add);
|
||||||
|
if (!$this->uid) {
|
||||||
|
debug_log("[error]# " . $this->mdWeixinUsers->db->last_query(), __FUNCTION__, $this->log_dir);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->uid = $row_wechat['userId'];
|
||||||
|
}
|
||||||
|
//判断是否有绑定马甲
|
||||||
|
$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 && !$param['cf_uid']) {
|
||||||
|
$this->uid = $row_wechat['maJiaId'];
|
||||||
|
}
|
||||||
|
$act_user = $this->topic_user_model->get(['topicId' => $topic_id, 'userId' => $this->uid]);
|
||||||
|
if (!$act_user && $topic_id) {
|
||||||
|
$act_data = [
|
||||||
|
'topicId' => $topic_id,
|
||||||
|
'userId' => $this->uid,
|
||||||
|
'pid' => 0,
|
||||||
|
"createTime" => date('Y-m-d H:i:s')
|
||||||
|
];
|
||||||
|
$row_wechat['bizId'] && $act_data['bizId'] = $row_wechat['bizId'];
|
||||||
|
if ($param['cf_uid']) {
|
||||||
|
$p_act_user = $this->topic_user_model->get(['userId' => $param['cf_uid'], 'topicId' => $topic_id], 'userId,channelId');
|
||||||
|
if ($p_act_user['channelId']) {
|
||||||
|
$act_data['channelId'] = $p_act_user['channelId'];
|
||||||
|
} else {
|
||||||
|
$p_act_user['organizationId'] && $act_data['channelId'] = $p_act_user['userId'];
|
||||||
|
}
|
||||||
|
$act_data['pid'] = $p_act_user['userId'] ? $p_act_user['userId'] : 0;
|
||||||
|
}
|
||||||
|
//管理员自己归属到自己
|
||||||
|
$topic_row = $this->topic_model->get(['id' => $topic_id]);
|
||||||
|
if ($row_wechat['topOrgId'] && $topic_row['organizationId'] == $row_wechat['topOrgId']) {
|
||||||
|
$act_data['channelId'] = $this->uid;
|
||||||
|
$act_data['organizationId'] = $row_wechat['organizationId'];
|
||||||
|
}
|
||||||
|
$act_user['id'] = $this->topic_user_model->add($act_data);
|
||||||
|
}
|
||||||
|
$_SESSION[self::SESSION_KEY]['userId'] = $this->uid;
|
||||||
|
$_SESSION[self::SESSION_KEY]['act_uid'] = $act_user['id'];
|
||||||
|
echo("<script>setTimeout('window.location.reload()', 1);</script>");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class Login extends CI_Controller{
|
|||||||
if(!$user){
|
if(!$user){
|
||||||
$this->show_json('',400,'用户不存在');
|
$this->show_json('',400,'用户不存在');
|
||||||
}
|
}
|
||||||
$redis = &load_cache('redis');
|
$redis = &load_cache();
|
||||||
$key = "sylive_login_code_".$mobile;
|
$key = "sylive_login_code_".$mobile;
|
||||||
$code = $redis->get($key);
|
$code = $redis->get($key);
|
||||||
if(!$code){
|
if(!$code){
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
require_once 'Common.php';
|
require_once 'Common.php';
|
||||||
|
|
||||||
class User extends Admin
|
class User extends Admin
|
||||||
@@ -9,8 +9,9 @@ class User extends Admin
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->load->model('market/Market_sylive_organization_model', 'mdSyliveOrganization');
|
$this->load->model('market/Market_sylive_organization_model', 'mdSyliveOrganization');
|
||||||
|
$this->load->model('market/Market_sytopic_enroll_model', 'sytopic_enroll_model');
|
||||||
$this->load->library('market/sylive_entity');
|
$this->load->library('market/sylive_entity');
|
||||||
$this->user = $this->user_model->get(['userId'=>$this->uid],'bizId,topOrgId');
|
$this->user = $this->user_model->get(['userId' => $this->uid], 'bizId,topOrgId');
|
||||||
$this->biz_id = $this->user['bizId'];
|
$this->biz_id = $this->user['bizId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,6 +21,8 @@ class User extends Admin
|
|||||||
$row = $this->market_sylive_organization_model->get(['organizationId' => $this->user['topOrgId']]);
|
$row = $this->market_sylive_organization_model->get(['organizationId' => $this->user['topOrgId']]);
|
||||||
$biz_row = $this->market_sylive_organization_model->get(['organizationId' => $this->biz_id]);
|
$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;
|
$headimg = $row['logo'] ? build_qiniu_image_url($row['logo']) : Sylive_entity::HD_IMG;
|
||||||
|
$type = $this->input->get('type');
|
||||||
|
$this->data['type'] = $type;
|
||||||
$this->data['headimg'] = $headimg;
|
$this->data['headimg'] = $headimg;
|
||||||
$this->data['biz_name'] = $biz_row['organizationName'];
|
$this->data['biz_name'] = $biz_row['organizationName'];
|
||||||
$this->data['biz_id'] = $this->biz_id;
|
$this->data['biz_id'] = $this->biz_id;
|
||||||
@@ -81,13 +84,12 @@ class User extends Admin
|
|||||||
$this->show_json('', 400, '请输入正确手机号');
|
$this->show_json('', 400, '请输入正确手机号');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($type == 1) {
|
if ($type == 1) {
|
||||||
$re_org = $this->market_sylive_organization_model->get(['parentId' => $biz_id, 'organizationType' => 3, 'status' => 0]);
|
$re_org = $this->market_sylive_organization_model->get(['parentId' => $biz_id, 'organizationType' => 3, 'status' => 0]);
|
||||||
if (!$re_org) {
|
if (!$re_org) {
|
||||||
$this->show_json('', 400, '门店未添加店长类型,请联系管理员');
|
$this->show_json('', 400, '门店未添加店长类型,请联系管理员');
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$type = 0;
|
$type = 0;
|
||||||
$re_org = $this->market_sylive_organization_model->get(['parentId' => $biz_id, 'organizationType' => 4, 'status' => 0]);
|
$re_org = $this->market_sylive_organization_model->get(['parentId' => $biz_id, 'organizationType' => 4, 'status' => 0]);
|
||||||
if (!$re_org) {
|
if (!$re_org) {
|
||||||
@@ -118,8 +120,7 @@ class User extends Admin
|
|||||||
];
|
];
|
||||||
|
|
||||||
$group = $this->groups_model->get($where);
|
$group = $this->groups_model->get($where);
|
||||||
if($group)
|
if ($group) {
|
||||||
{
|
|
||||||
$levelAry = $this->getLevelAry($group['groupsId']);
|
$levelAry = $this->getLevelAry($group['groupsId']);
|
||||||
$value = ['userId' => $id, 'activityId' => $group['activityId'], 'groupsId' => $group['groupsId'], 'type' => $type, 'createTime' => date('Y-m-d H:i:s')];
|
$value = ['userId' => $id, 'activityId' => $group['activityId'], 'groupsId' => $group['groupsId'], 'type' => $type, 'createTime' => date('Y-m-d H:i:s')];
|
||||||
$data = array_merge($value, $levelAry);
|
$data = array_merge($value, $levelAry);
|
||||||
@@ -171,12 +172,12 @@ class User extends Admin
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->user_model->update(['status' => $status], ['userId' => $userId]);
|
$this->user_model->update(['status' => $status], ['userId' => $userId]);
|
||||||
if($status==-1){
|
if ($status == -1) {
|
||||||
$where = [
|
$where = [
|
||||||
'userId' => $userId,
|
'userId' => $userId,
|
||||||
'status>=' => 0,
|
'status>=' => 0,
|
||||||
];
|
];
|
||||||
$this->groups_user_model->update(['status'=>-1],$where);
|
$this->groups_user_model->update(['status' => -1], $where);
|
||||||
$where = [
|
$where = [
|
||||||
'userId' => $userId,
|
'userId' => $userId,
|
||||||
'groupsId>=' => 0,
|
'groupsId>=' => 0,
|
||||||
@@ -214,4 +215,68 @@ class User extends Admin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//专题报名
|
||||||
|
public function enroll()
|
||||||
|
{
|
||||||
|
$this->data['_title'] = '我的推广';
|
||||||
|
$this->show_view('h5/market/sylive2/user/enroll');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function enLists()
|
||||||
|
{
|
||||||
|
$page = intval($this->input->get('page'));
|
||||||
|
$status = $this->input->get('status');
|
||||||
|
!$page && $page = 1;
|
||||||
|
$size = 20;
|
||||||
|
$user = $this->user_model->get(['userId' => $this->session['userId']]);
|
||||||
|
$where = [
|
||||||
|
'status<>' => -1,
|
||||||
|
];
|
||||||
|
if ($user['bizId'] == $user['organizationId']) { //店长
|
||||||
|
$where['bizId'] = $user['bizId'];
|
||||||
|
} else {
|
||||||
|
$where['channelId'] = $this->session['userId'];
|
||||||
|
}
|
||||||
|
if (strlen($status)) {
|
||||||
|
$where['status'] = intval($status);
|
||||||
|
}
|
||||||
|
$total = $this->sytopic_enroll_model->count($where);
|
||||||
|
$lists = [];
|
||||||
|
if ($total) {
|
||||||
|
$res = $this->sytopic_enroll_model->select($where, 'id desc', $page, $size);
|
||||||
|
$status_array = [
|
||||||
|
0 => ['name' => '待确认', 'class' => 'bg-f8e26a'],
|
||||||
|
1 => ['name' => '已确认', 'class' => 'bg-2fdc53'],
|
||||||
|
2 => ['name' => '无效单', 'class' => 'bg-f7']
|
||||||
|
];
|
||||||
|
$topicIds = array_column($res, 'topicId');
|
||||||
|
$topicIdsStr = implode(',', $topicIds);
|
||||||
|
$topicMap = [];
|
||||||
|
$topicIdsStr && $topicMap = $this->topic_model->map('id', 'title', ["id in ({$topicIdsStr})" => null], '', '', '', 'id,title');
|
||||||
|
$channelUserIds = array_column($res, 'channelId');
|
||||||
|
$channelUserIdsStr = implode(',', array_unique($channelUserIds));
|
||||||
|
$channelUserMap = [];
|
||||||
|
$channelUserIdsStr && $channelUserMap = $this->user_model->map('userId', 'uname', ["userId in ({$channelUserIdsStr})" => null], '', '', '', 'userId,uname');
|
||||||
|
foreach ($res as $val) {
|
||||||
|
$topicTitle = $topicMap[$val['topicId']];
|
||||||
|
$channelName = $channelUserMap[$val['channelId']];
|
||||||
|
$temp = [
|
||||||
|
'name' => $val['name'],
|
||||||
|
'phone' => mobile_asterisk($val['mobile']),
|
||||||
|
'time' => date('Y-m-d H:i', strtotime($val['enTime'])),
|
||||||
|
'source' => [
|
||||||
|
['name' => $topicTitle, 'class' => 'bg-f8e26a'],
|
||||||
|
['name' => '团队带客·' . $channelName, 'class' => 'bg-f7'],
|
||||||
|
// ['name' => '自然客', 'class' => 'bg-2fdc53']
|
||||||
|
],
|
||||||
|
'status' => $status_array[$val['status']],
|
||||||
|
];
|
||||||
|
$lists[] = $temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['list'] = $lists;
|
||||||
|
$data['total'] = $total;
|
||||||
|
$this->show_json($data, 200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ class Welcome extends Admin {
|
|||||||
$this->session['org_id'] = $this->input->get('org_id');
|
$this->session['org_id'] = $this->input->get('org_id');
|
||||||
$this->session['userId'] = $this->input->get('userId');
|
$this->session['userId'] = $this->input->get('userId');
|
||||||
$_SESSION[self::SESSION_KEY] = $this->session;
|
$_SESSION[self::SESSION_KEY] = $this->session;
|
||||||
$org_url = http_host_com('home')."/h5/market/sylive2/biz";
|
$org_url = http_host_com('home')."/h5/market/sylive2/biz/applists";
|
||||||
redirect($org_url);
|
redirect($org_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
require_once APPPATH . 'controllers/h5/market/sylive2/Common.php';;
|
||||||
|
|
||||||
|
class Ucenter extends Wx
|
||||||
|
{
|
||||||
|
|
||||||
|
private $a_id, $skey;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->skey = $this->input->get('skey');
|
||||||
|
$param = $this->myencryption->base64url_decode($this->skey);
|
||||||
|
$this->a_id = intval($param[self::SIGN_TOP_KEY]);//活动id
|
||||||
|
if (!$this->a_id) {
|
||||||
|
throw new Hd_exception("参数错误", 400);
|
||||||
|
}
|
||||||
|
$this->data['skey'] = $this->skey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$user = $this->user_model->get(['userId' => $this->uid], 'unionid,nickname,headimg');
|
||||||
|
$lists = [];
|
||||||
|
$lists[] = ['title' => '联系客服', 'url' => ''];
|
||||||
|
$info = [
|
||||||
|
'title' => $user['nickname'],
|
||||||
|
'logo' => $user['headimg'],
|
||||||
|
'list' => $lists
|
||||||
|
];
|
||||||
|
$this->data['info'] = $info;
|
||||||
|
$this->data['_title'] = '我的';
|
||||||
|
$this->show_view('h5/market/sytopic/ucenter/index');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
require_once APPPATH . 'controllers/h5/market/sylive2/Common.php';
|
||||||
|
require_once COMMPATH . 'third_party/phpqrcode/phpqrcode.php';
|
||||||
|
|
||||||
|
class Welcome extends Wx
|
||||||
|
{
|
||||||
|
const ENROLL_SIGN_KEY = 'sytopic_enroll_code_'; //报名验证码key
|
||||||
|
private $a_id, $skey;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->load->model('market/Market_sytopic_module_option_model', 'module_option_model');
|
||||||
|
$this->load->model('market/Market_sytopic_enroll_model', 'sytopic_enroll_model');
|
||||||
|
$this->load->library('qiniu');
|
||||||
|
$this->skey = $this->input->get_post('skey');
|
||||||
|
$param = $this->myencryption->base64url_decode($this->skey);
|
||||||
|
$this->a_id = intval($param[self::SIGN_TOP_KEY]);//活动id
|
||||||
|
if (!$this->a_id) {
|
||||||
|
throw new Hd_exception("参数错误", 400);
|
||||||
|
}
|
||||||
|
$this->data['skey'] = $this->skey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$row = $this->topic_model->get(['id' => $this->a_id]);
|
||||||
|
$actUser = $this->topic_user_model->get(['id' => $this->act_uid]);
|
||||||
|
if (!$row) {
|
||||||
|
throw new Hd_exception('参数错误', 400);
|
||||||
|
}
|
||||||
|
$channelRow = [];
|
||||||
|
$actUser['channelId'] && $channelRow = $this->user_model->get(['userId' => $actUser['channelId']]);
|
||||||
|
$jsonData = json_decode($row['jsondata'], true);
|
||||||
|
$info = [
|
||||||
|
'title' => $row['title'],
|
||||||
|
'isAdmin' => $this->user_model->checkTopicIsAdmin($this->uid, $this->a_id),
|
||||||
|
'channelName' => $channelRow ? $channelRow['uname'] : '',
|
||||||
|
'channelHeadImg' => $channelRow['headimg'] ?: 'https://img.liche.cn/liche/market/202407/p_e1065373f27937f69142c28ce975a398.png',
|
||||||
|
'banner' => $jsonData['banner'] ? build_qiniu_image_url($jsonData['banner']) : '',
|
||||||
|
'bgColor' => $jsonData['bg_color'] ?: '',
|
||||||
|
];
|
||||||
|
$moduleLists = $this->module_option_model->getTopicModelOptionsList($this->a_id);
|
||||||
|
$this->data['modules'] = array_values($moduleLists);
|
||||||
|
$this->data['info'] = $info;
|
||||||
|
//获取配置信息
|
||||||
|
$wx_info = $this->share_info([], $row);//微信分享
|
||||||
|
$this->data['share'] = $wx_info['share'];
|
||||||
|
$this->show_view('h5/market/sytopic/index');
|
||||||
|
}
|
||||||
|
|
||||||
|
//报名
|
||||||
|
public function enroll()
|
||||||
|
{
|
||||||
|
$redis = &load_cache();
|
||||||
|
$optionId = intval($this->input->post('optionId'));
|
||||||
|
$info = $this->input->post('info');
|
||||||
|
$name = $info['name'];
|
||||||
|
$mobile = $info['phone'];
|
||||||
|
$code = $info['code'];
|
||||||
|
if (!$name) {
|
||||||
|
$this->show_json('', 400, '请输入姓名');
|
||||||
|
}
|
||||||
|
$key = self::ENROLL_SIGN_KEY . $mobile;
|
||||||
|
if (!$code || $code != $redis->get($key)) {
|
||||||
|
$this->show_json('', 400, '请输入正确的验证码');
|
||||||
|
}
|
||||||
|
$result = $this->sytopic_enroll_model->enroll($optionId, $this->act_uid, $name, $mobile);
|
||||||
|
if (!$result['code']) {
|
||||||
|
$this->show_json('', 400, $result['msg']);
|
||||||
|
}
|
||||||
|
$this->show_json('', 200, '提交成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取报名验证码
|
||||||
|
public function get_code()
|
||||||
|
{
|
||||||
|
$mobile = $this->input->post('mobile');
|
||||||
|
if (!mobile_valid($mobile)) {
|
||||||
|
$this->show_json('', 400, '请输入正确的手机号码');
|
||||||
|
}
|
||||||
|
$redis = &load_cache();
|
||||||
|
$key = self::ENROLL_SIGN_KEY . $mobile;
|
||||||
|
$code = $redis->get($key);
|
||||||
|
if ($code) {
|
||||||
|
$this->show_json('', 200, '验证码已发送');
|
||||||
|
}
|
||||||
|
if (!$code) {
|
||||||
|
$this->load->helper('string');
|
||||||
|
$code = random_string('numeric', 4);
|
||||||
|
$redis->save($key, $code, 60 * 5);
|
||||||
|
}
|
||||||
|
$content = "【好店云】您的验证码为: {$code},五分钟之内有效,请勿泄露于他人,!";
|
||||||
|
b2m_send_sms($mobile, $content);
|
||||||
|
$this->show_json('', 200, '验证码已发送');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function share()
|
||||||
|
{
|
||||||
|
$row = $this->topic_model->get(['id' => $this->a_id]);
|
||||||
|
if (!$row) {
|
||||||
|
throw new Hd_exception('参数错误', 400);
|
||||||
|
}
|
||||||
|
$shareImg = json_decode($row['shareImg'], true);
|
||||||
|
$shareTitle = $row['shareTitle'] ? json_decode($row['shareTitle'], true) : [];
|
||||||
|
$lists = [];
|
||||||
|
if ($shareImg) {
|
||||||
|
$share_skey = self::SIGN_TOP_KEY . "=" . $this->a_id . "&cf_uid=" . $this->uid;
|
||||||
|
$share_url = http_host_com('home') . "/h5/market/sytopic?skey=" . $this->myencryption->base64url_encode($share_skey);
|
||||||
|
$errorCorrectionLevel = 'L'; //容错级别
|
||||||
|
$matrixPointSize = 5; //生成图片大小
|
||||||
|
//生成二维码图片
|
||||||
|
$file_name = md5($share_url) . '.png';
|
||||||
|
$file_path = "temp/{$file_name}";
|
||||||
|
if (!file_exists(FCPATH . 'temp/')) {
|
||||||
|
$oldumask = umask(0);
|
||||||
|
mkdir(FCPATH . 'temp/', 0777, true);
|
||||||
|
umask($oldumask);
|
||||||
|
}
|
||||||
|
QRcode::png($share_url, FCPATH . $file_path, $errorCorrectionLevel, $matrixPointSize, 1);
|
||||||
|
$res = $this->qiniu->save($file_name, file_get_contents(FCPATH . $file_path));
|
||||||
|
if ($res['url']) {
|
||||||
|
@unlink(FCPATH . $file_path);
|
||||||
|
$qr_code = build_qiniu_image_url($res['url']);
|
||||||
|
} else {
|
||||||
|
$qr_code = '/h5/market/sylive2/myqrcode/get?url=' . $share_url;
|
||||||
|
}
|
||||||
|
foreach ($shareImg as $item) {
|
||||||
|
$img_url = build_qiniu_image_url($item);
|
||||||
|
$img_info = file_get_contents($img_url . '?imageInfo');
|
||||||
|
if ($img_info) {
|
||||||
|
$img_info = json_decode($img_info, true);
|
||||||
|
}
|
||||||
|
$lists[] = [
|
||||||
|
"img" => $img_url,
|
||||||
|
"code" => $qr_code,
|
||||||
|
'width' => $img_info['width'] ? $img_info['width'] : 750,
|
||||||
|
'height' => $img_info['height'] ? $img_info['height'] : 1130,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$user = $this->user_model->get(['userId' => $this->uid], 'uname,nickname');
|
||||||
|
$this->data['posterTip'] = "{$user['nickname']}诚挚邀请您参与";
|
||||||
|
$this->data['fillStyle'] = '#fff';
|
||||||
|
$this->data['lists'] = $lists;
|
||||||
|
$this->data['shareTitle'] = $shareTitle;
|
||||||
|
//微信分享
|
||||||
|
$wx_info = $this->share_info([], $row);
|
||||||
|
$this->data['sign_package'] = $wx_info['sign_package'];
|
||||||
|
$this->data['share'] = $wx_info['share'];
|
||||||
|
$this->show_view('h5/market/sytopic/share');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<link rel="stylesheet" href="/css/h5/market/sytopic/h5.css?20230225">
|
||||||
|
<body>
|
||||||
|
<div id="app" style="min-height: 100vh;" class="bg-f6 relative">
|
||||||
|
<header class="absolute left-0 top-0 right-0 z-index-1">
|
||||||
|
<div class="fn-flex fn-flex-between fn-flex-middle ulib-rb30 bg-fff pl30 pr30 pt20 pb20">
|
||||||
|
<div class="font-26" @click="logout()"><i class="iconfont icon-tuichu"></i><span class="ml5">退出</span>
|
||||||
|
</div>
|
||||||
|
<a class="fn-flex" href="/h5/market/sylive2">
|
||||||
|
<span class="ulib-r750 inline-block pt5 pb5 pl10 pr10 font-24 bg-000 color-fff"><i class="iconfont icon-refresh"></i>切换机构</span>
|
||||||
|
<!--van-tag color="#1a1a1a" round class="ml20">
|
||||||
|
<van-icon name="replay" class="mr5"></van-icon>
|
||||||
|
切换机构
|
||||||
|
</van-tag-->
|
||||||
|
</a>
|
||||||
|
<!--
|
||||||
|
<div class="fn-flex" v-if="multi_org===1" @click="orgSelect">
|
||||||
|
<van-tag color="#1a1a1a" round class="ml20">
|
||||||
|
<van-icon name="replay" class="mr5"></van-icon>
|
||||||
|
切换机构
|
||||||
|
</van-tag>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<!-- 选择 -->
|
||||||
|
<div class="choose relative" style="height:100%">
|
||||||
|
<div class="absolute bg-size-cover bg-no-repeat left-0 top-0 bottom-0 right-0 pt80"
|
||||||
|
:style="'background-image: url('+bg+');'">
|
||||||
|
<div class="card-module">
|
||||||
|
<div class="inner30">
|
||||||
|
<div class="pt40 pb40">
|
||||||
|
<h3 class="font-42">欢迎使用</h3>
|
||||||
|
<p class="font-26 mt20">好店云私域营销系统</p>
|
||||||
|
</div>
|
||||||
|
<div class="pt100">
|
||||||
|
<ul>
|
||||||
|
<a href="/h5/market/sylive2/biz">
|
||||||
|
<li class="bg-f9 inner30 ulib-r20 fn-flex fn-flex-middle mb30">
|
||||||
|
<i class="d-icon-1 inline-block"></i><h5 class="ml20 mr10 font-32">私域直播</h5>
|
||||||
|
<!--i class="d-icon-3"></i-->
|
||||||
|
</li>
|
||||||
|
</a>
|
||||||
|
<a href="/h5/market/sylive2/biz?type=1">
|
||||||
|
<li class="bg-f9 inner30 ulib-r20 fn-flex fn-flex-middle mb30">
|
||||||
|
<i class="d-icon-2 inline-block"></i><h5 class="ml20 mr10 font-32">营销专题</h5>
|
||||||
|
<i class="d-icon-4"></i>
|
||||||
|
</li>
|
||||||
|
</a>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
let app = new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
bg: '/img/h5/sytopic/bg.jpg',
|
||||||
|
multi_org: <?=$multi_org ? 1 : 0?>,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
bindCarNext() {
|
||||||
|
this.$refs.carswiper.next();
|
||||||
|
},
|
||||||
|
bindCarPrev() {
|
||||||
|
this.$refs.carswiper.prev();
|
||||||
|
},
|
||||||
|
logout() {
|
||||||
|
$.get('/h5/market/sylive2/login/logout', function (response) {
|
||||||
|
if (response.code == 200) {
|
||||||
|
mDialog.msg({
|
||||||
|
duration: 250,
|
||||||
|
pause: 2000,
|
||||||
|
content: response.msg,
|
||||||
|
onClose: function () {
|
||||||
|
window.location = '/h5/market/sylive2/login'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
mDialog.msg({
|
||||||
|
duration: 250,
|
||||||
|
pause: 2000,
|
||||||
|
content: response.msg
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 'json')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<?= $this->load->view('h5/market/sylive2/hidden_wx_share') ?>
|
||||||
|
</body>
|
||||||
@@ -1,38 +1,74 @@
|
|||||||
|
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/vant.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/vant.min.css">
|
||||||
|
<link rel="stylesheet" href="/css/h5/market/sytopic/h5.css?20230225">
|
||||||
<body class="bg-f6">
|
<body class="bg-f6">
|
||||||
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
<div id="app" style="min-height: 100vh;" class="bg-f6 relative">
|
||||||
<div class="bg-f6" id="app" ref="app">
|
<header class="absolute left-0 top-0 right-0 z-index-1">
|
||||||
<div class="container">
|
<div class="fn-flex fn-flex-between fn-flex-middle ulib-rb30 bg-fff pl30 pr30 pt20 pb20">
|
||||||
<div class="pt30 pl30 pr30 fn-clear">
|
<div class="font-26"><span class="ml5"></span></div>
|
||||||
<a class="block fn-fl pt10 pb10 pl20 pr20 bg-ccc font-28 ulib-r750" href="javascript:;" @click="logout()">
|
<a class="fn-flex" href="/h5/market/sylive2/biz/applists">
|
||||||
<i class="iconfont icon-tuichu text-middle"></i><span class="ml5 text-middle">退出</span>
|
<span class="ulib-r750 inline-block pt5 pb5 pl10 pr10 font-24 bg-000 color-fff"><i class="iconfont icon-refresh"></i>切换应用</span>
|
||||||
|
<!--van-tag color="#1a1a1a" round class="ml20">
|
||||||
|
<van-icon name="replay" class="mr5"></van-icon>
|
||||||
|
切换应用
|
||||||
|
</van-tag-->
|
||||||
</a>
|
</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>
|
|
||||||
</a>
|
|
||||||
<?}?>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
<div class="container">
|
||||||
<div class="inner30 pt0">
|
<div class="inner30 pt0">
|
||||||
<a class="block mt30 pb30 bg-fff overflowhidden box-shadow-lightGray ulib-r20" :href="item.url" v-for="(item,index) in list">
|
<!--
|
||||||
|
<a class="block mt30 pb30 bg-fff overflowhidden box-shadow-lightGray ulib-r20" :href="item.url"
|
||||||
|
v-for="(item,index) in list">
|
||||||
<img class="imgsize-690X310" :src="item.img" alt="#">
|
<img class="imgsize-690X310" :src="item.img" alt="#">
|
||||||
<div class="mt20 pl30 pr30 font-30 color-333">{{item.title}}</div>
|
<div class="mt20 pl30 pr30 font-30 color-333">{{item.title}}</div>
|
||||||
<div class="mt10 pl30 pr30 font-24 color-999">{{item.time}}</div>
|
<div class="mt10 pl30 pr30 font-24 color-999">{{item.time}}</div>
|
||||||
</a>
|
</a>
|
||||||
|
-->
|
||||||
|
<a v-for="(item,index) in list" :key="index" class="overflowhidden ulib-r20 bg-fff mb30 box-shadow-lightGray" :href="item.url">
|
||||||
|
<van-image :src="item.img"></van-image>
|
||||||
|
<div class="inner30 fn-flex fn-flex-between">
|
||||||
|
<div class="wp70">
|
||||||
|
<h4 class="font-28 text-nowrap">{{item.title}}</h4>
|
||||||
|
<p class="font-22 color-999 mt20">{{item.time}}</p>
|
||||||
|
</div>
|
||||||
|
<div class="font-24 text-right">
|
||||||
|
<span class="block text-nowrap mt10 pr10 pb10" v-if="item.userCount">
|
||||||
|
<van-icon name="eye-o"></van-icon> 浏览 {{item.userCount}}
|
||||||
|
</span>
|
||||||
|
<span class="ulib-r750 bg-f8e26a inline-block pt5 pb5 pl10 pr10" v-if="item.lzCount">
|
||||||
|
<van-icon name="gold-coin-o"></van-icon> 留资 {{item.lzCount}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
|
<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="pt100 pb100 text-center color-ccc" v-if="isNoData"><span
|
||||||
<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>
|
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="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>
|
</mugen-scroll>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?if($isBiz){?>
|
<aside class="fixed right-0 bottom-0 mr30 mb100 z-index-10">
|
||||||
<a class="bottom-opt bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive2/user">
|
<ul>
|
||||||
<div class="absolute box-center-middle line-height-13 font-22">
|
<a href="/h5/market/sylive2/user/enroll" v-if="type===1">
|
||||||
<div>顾问</div>
|
<li class="mt20">
|
||||||
<div>管理</div>
|
<i class="inline-block d-icon-5"></i>
|
||||||
</div>
|
</li>
|
||||||
</a>
|
</a>
|
||||||
<?}?>
|
<a href="/h5/market/sylive2/user?type=<?=$type?>" v-if="isBiz">
|
||||||
|
<li class="mt20">
|
||||||
|
<i class="inline-block d-icon-6"></i>
|
||||||
|
</li>
|
||||||
|
</a>
|
||||||
|
</ul>
|
||||||
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -45,7 +81,9 @@
|
|||||||
isNoData: false,
|
isNoData: false,
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 20,
|
size: 20,
|
||||||
list:[],
|
type: <?=$this->input->get('type') ? intval($this->input->get('type')) : 0?>,
|
||||||
|
list: [],
|
||||||
|
isBiz: <?=$isBiz ? 1 : 0?>,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
@@ -53,18 +91,19 @@
|
|||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
//拉取数据
|
//拉取数据
|
||||||
fetchData: function() {
|
fetchData: function () {
|
||||||
this.getOrderList()
|
this.getOrderList()
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取大区列表
|
//获取大区列表
|
||||||
getOrderList(){
|
getOrderList() {
|
||||||
let that=this;
|
let that = this;
|
||||||
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
if (!that.isNoData && !that.isDataEnd && !that.loading) {
|
||||||
that.loading = true;
|
that.loading = true;
|
||||||
//请求接口
|
//请求接口
|
||||||
$.get('/h5/market/sylive2/biz/act_list', {
|
$.get('/h5/market/sylive2/biz/act_list', {
|
||||||
'page': that.page
|
'page': that.page,
|
||||||
|
'type': that.type
|
||||||
}, function (result) {
|
}, function (result) {
|
||||||
that.loading = false;
|
that.loading = false;
|
||||||
that.page = that.page + 1;
|
that.page = that.page + 1;
|
||||||
@@ -77,27 +116,6 @@
|
|||||||
}, 'json')
|
}, 'json')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
logout() {
|
|
||||||
$.get('/h5/market/sylive2/login/logout', function (response) {
|
|
||||||
if (response.code == 200) {
|
|
||||||
mDialog.msg({
|
|
||||||
duration: 250,
|
|
||||||
pause: 2000,
|
|
||||||
content: response.msg,
|
|
||||||
onClose: function () {
|
|
||||||
window.location = '/h5/market/sylive2/login'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
mDialog.msg({
|
|
||||||
duration: 250,
|
|
||||||
pause: 2000,
|
|
||||||
content: response.msg
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, 'json')
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -15,4 +15,6 @@
|
|||||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/swiper/js/swiper.min.js"></script>
|
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/swiper/js/swiper.min.js"></script>
|
||||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript//vue-mugen-scroll.js"></script>
|
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript//vue-mugen-scroll.js"></script>
|
||||||
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||||
|
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/vant.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/vant.min.css">
|
||||||
</head>
|
</head>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="absolute box-middle left-0 right-0 pl80 pr80 pb220">
|
<div class="absolute box-middle left-0 right-0 pl80 pr80 pb220">
|
||||||
<div class="color-fff">
|
<div class="color-fff">
|
||||||
<div class="font-52">手机号登录</div>
|
<div class="font-52">手机号登录</div>
|
||||||
<div class="mt20 font-28">欢迎使用好店云-私域直播系统</div>
|
<div class="mt20 font-28">好店云私域营销系统</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="relative mt50 bg-fff-op15 ulib-r750">
|
<div class="relative mt50 bg-fff-op15 ulib-r750">
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<link rel="stylesheet" href="/css/h5/market/sytopic/h5.css?20230225">
|
||||||
|
<body>
|
||||||
|
<div id="app" style="min-height: 100vh;" class="bg-f6 relative">
|
||||||
|
<!-- 列表 -->
|
||||||
|
<div class="relative pb30">
|
||||||
|
<van-tabs v-model="active" sticky color="#000" @click="onChange">
|
||||||
|
<van-tab v-for="(item,index) in tab_list" :title="item.title"></van-tab>
|
||||||
|
</van-tabs>
|
||||||
|
<div class="list">
|
||||||
|
<van-list
|
||||||
|
v-model="loading"
|
||||||
|
:finished="finished"
|
||||||
|
finished-text="没有更多了"
|
||||||
|
:error.sync="error"
|
||||||
|
error-text="请求失败,点击重新加载"
|
||||||
|
@load="onLoad"
|
||||||
|
>
|
||||||
|
<div v-for="(item,index) in list" class="card-module overflowhidden">
|
||||||
|
<h3 class="font-32">{{item.name}} {{item.phone}}</h3>
|
||||||
|
<p class="font-24 color-999 mt20">{{item.time}}</p>
|
||||||
|
<p class="mt20 font-22">来源:
|
||||||
|
<span v-for="(it, idx) in item.source" :key="index"
|
||||||
|
:class="[' pt5 pb5 pl15 pr15 ulib-r750 mr10',it.class]">{{it.name}}</span>
|
||||||
|
</p>
|
||||||
|
<span :class="['ulib-rtr20 ulib-rbl20 absolute right-0 top-0 font-24 pt5 pb5 pl15 pr15', item.status.class]">{{item.status.name}}</span>
|
||||||
|
</div>
|
||||||
|
</van-list>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let app = new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tab_list: [{
|
||||||
|
title: '全部',
|
||||||
|
id: 1,
|
||||||
|
type: 0
|
||||||
|
}, {
|
||||||
|
title: '待确认',
|
||||||
|
id: 2,
|
||||||
|
type: 0
|
||||||
|
}, {
|
||||||
|
title: '已确认',
|
||||||
|
id: 3,
|
||||||
|
type: 1
|
||||||
|
}, {
|
||||||
|
title: '无效',
|
||||||
|
id: 4,
|
||||||
|
type: 2
|
||||||
|
}],
|
||||||
|
active: 0,
|
||||||
|
list: [],
|
||||||
|
loading: false,
|
||||||
|
finished: false,
|
||||||
|
page: 1,
|
||||||
|
error: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onChange() {
|
||||||
|
this.page = 1
|
||||||
|
this.list = []
|
||||||
|
this.onLoad()
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let that = this
|
||||||
|
let type = ''
|
||||||
|
if (that.active) {
|
||||||
|
type = that.tab_list[that.active].type
|
||||||
|
}
|
||||||
|
//请求接口
|
||||||
|
$.get('/h5/market/sylive2/user/enLists', {page: that.page, status: type}, function (res) {
|
||||||
|
that.loading = false;
|
||||||
|
if (res.code == 200) {
|
||||||
|
that.page = that.page + 1
|
||||||
|
that.list = that.list.concat(res.data.list);
|
||||||
|
if (that.list.length >= res.data.total) {
|
||||||
|
that.finished = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
that.error = true;
|
||||||
|
msgDia = mDialog.msg({
|
||||||
|
duration: 250,
|
||||||
|
pause: 2000,
|
||||||
|
content: res.msg
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}, 'json');
|
||||||
|
// 异步更新数据
|
||||||
|
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
|
||||||
|
// setTimeout(() => {
|
||||||
|
// for (let i = 0; i < 10; i++) {
|
||||||
|
// this.list.push(this.list.length + 1);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 加载状态结束
|
||||||
|
// this.loading = false;
|
||||||
|
//
|
||||||
|
// // 数据全部加载完成
|
||||||
|
// if (this.list.length >= 40) {
|
||||||
|
// this.finished = true;
|
||||||
|
// }
|
||||||
|
// }, 1000);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<a class="block bg-1a1a1a pt25 pb25 text-center font-36 color-fff ulib-r10" @click="showForm(-1)"
|
<a class="block bg-1a1a1a pt25 pb25 text-center font-36 color-fff ulib-r10" @click="showForm(-1)"
|
||||||
href="javascript:void(0)">新增顾问</a>
|
href="javascript:void(0)">新增顾问</a>
|
||||||
</div>
|
</div>
|
||||||
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive2/biz">
|
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive2/biz?type=<?=$type?>">
|
||||||
<i class="iconfont icon-shouye text-middle font-36"></i>
|
<i class="iconfont icon-shouye text-middle font-36"></i>
|
||||||
<div class="font-22">首页</div>
|
<div class="font-22">首页</div>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -0,0 +1,461 @@
|
|||||||
|
<link rel="stylesheet" href="/css/h5/market/sytopic/h5.css?2024111">
|
||||||
|
<body>
|
||||||
|
<style>.wp31{width: 31%;box-sizing:border-box;}</style>
|
||||||
|
<div id="app" style="min-height: 100vh;background-color:<?= $info['bgColor'] ?: '#f6f6f6' ?>" class="relative">
|
||||||
|
<header v-if="0" class="absolute left-0 top-0 right-0 z-index-1">
|
||||||
|
<div class="fn-flex fn-flex-between fn-flex-middle ulib-rb30 bg-fff pl30 pr30 pt20 pb20">
|
||||||
|
<a href="/h5/market/sylive2/biz?type=1" v-if="info.isAdmin">
|
||||||
|
<div class="font-26"><i class="iconfont icon-tuichu"></i><span class="ml5">返回</span></div>
|
||||||
|
</a>
|
||||||
|
<div class="fn-flex">
|
||||||
|
<a href="/h5/market/sytopic/ucenter?skey=<?= $skey ?>">
|
||||||
|
<van-tag color="#1a1a1a" round class="ml20">
|
||||||
|
<van-icon name="gem-o" class="mr5"></van-icon>
|
||||||
|
我的权益
|
||||||
|
</van-tag>
|
||||||
|
</a>
|
||||||
|
<a href="/h5/market/sytopic/welcome/share?skey=<?= $skey ?>" v-if="info.isAdmin">
|
||||||
|
<van-tag color="#1a1a1a" round class="ml20"><i class="iconfont icon-fenxiang mr5"></i>分享</van-tag>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="fixed right-0 top-0 z-index-1 mt100">
|
||||||
|
<ul class="font-24 color-fff">
|
||||||
|
<!--
|
||||||
|
<li class="bg-000-op50 inner10 mb15 ulib-rl750">
|
||||||
|
<i class="iconfont icon-tuichu"></i><span class="ml10">退出</span>
|
||||||
|
</li>
|
||||||
|
<li class="bg-000-op50 inner10 mb15 ulib-rl750">
|
||||||
|
<a class="" href="/h5/market/sylive2/biz?type=1" class="color-fff" v-if="info.isAdmin">
|
||||||
|
<van-icon name="revoke"></van-icon>
|
||||||
|
<span class="ml10">返回</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
<li class="bg-000-op50 inner10 mb15 ulib-rl750"><a href="/h5/market/sytopic/ucenter?skey=<?= $skey ?>" class="color-fff"><van-icon name="gem-o"></van-icon><span class="ml10">权益</span></a></li>
|
||||||
|
-->
|
||||||
|
<li class="bg-000-op50 inner10 mb15 ulib-rl750" v-if="info.isAdmin">
|
||||||
|
<a href="/h5/market/sylive2/biz?type=1" class="color-fff">
|
||||||
|
<van-icon name="replay"></van-icon>
|
||||||
|
<span class="ml10">切换</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="bg-000-op50 inner10 mb15 ulib-rl750" v-if="info.isAdmin">
|
||||||
|
<a href="/h5/market/sytopic/welcome/share?skey=<?= $skey ?>" class="color-fff">
|
||||||
|
<i class="iconfont icon-fenxiang"></i><span class="ml10">分享</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- 头图模块 -->
|
||||||
|
<div style="margin-bottom: -7vw;" v-if="info && info.banner">
|
||||||
|
<van-image :src="info.banner"></van-image>
|
||||||
|
</div>
|
||||||
|
<template v-for="(item,k) in modules" v-if="modules">
|
||||||
|
<!-- 报名模块 - 大图轮播 -->
|
||||||
|
<div class="card-module" v-if="item.type && item.type==2 && item.lists && item.lists.length>0">
|
||||||
|
<div class="absolute left-0 top-0 right-0" style="margin-top: -10vw;">
|
||||||
|
<van-notice-bar left-icon="" background="transparent" color="#f8e26a" :scrollable="false"
|
||||||
|
style="padding-left: 0;">
|
||||||
|
<van-swipe
|
||||||
|
vertical
|
||||||
|
class="notice-swipe"
|
||||||
|
:autoplay="3000"
|
||||||
|
:show-indicators="false"
|
||||||
|
>
|
||||||
|
<van-swipe-item v-if="0">
|
||||||
|
<span class="font-24 bg-000-op50 ulib-r750 pt5 pb5 pl15 pr15 inline-block">
|
||||||
|
<van-icon name="point-gift" class="mr5"></van-icon>张三1领取了51000元大礼包
|
||||||
|
</span>
|
||||||
|
</van-swipe-item>
|
||||||
|
</van-swipe>
|
||||||
|
</van-notice-bar>
|
||||||
|
</div>
|
||||||
|
<div class="swpier relative">
|
||||||
|
<van-swipe
|
||||||
|
ref="carswiper"
|
||||||
|
class="swpier"
|
||||||
|
:autoplay="5000"
|
||||||
|
:show-indicators="false"
|
||||||
|
:initial-swipe="car_swiper_index"
|
||||||
|
>
|
||||||
|
<van-swipe-item v-for="(val,key) in item.lists" :key="key">
|
||||||
|
<div class="inner10">
|
||||||
|
<div class="fn-flex fn-flex-between fn-flex-middle">
|
||||||
|
<h3 class="font-36">{{val.title}}</h3>
|
||||||
|
<p><span class="font-24">官方指导价</span><span class="color-fdad67 ml10 font-30">{{val.subTitle}}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="font-24 mt20 color-888 line-height-15" style="text-align: justify;">
|
||||||
|
{{val.introduction}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<van-image :src="val.banner"></van-image>
|
||||||
|
</div>
|
||||||
|
<div class="fn-flex fn-flex-wrap fn-flex-between"
|
||||||
|
v-if="val.otherImg && val.otherImg.length>0">
|
||||||
|
<!-- 一行一图wp100 一行两图wp48 一行三图wp31 -->
|
||||||
|
<div :class="[val.otherImg.length==1?'wp100':val.otherImg.length==2?'wp48':'wp31','mb15']" v-for="val1 in val.otherImg">
|
||||||
|
<van-image class="wp100" :src="val1"></van-image>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pt20" v-if="val.showBtn">
|
||||||
|
<p class="text-center fn-flex fn-flex-center fn-flex-middle font-24"
|
||||||
|
v-if="val.showTime">
|
||||||
|
<template v-if="val.endTime>0">
|
||||||
|
<span class=" mr10">距截止日期还剩</span>
|
||||||
|
<van-count-down :time="val.endTime*1000" format="DD 天 HH 时 mm 分"/>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span class=" mr10">报名已截止</span>
|
||||||
|
</template>
|
||||||
|
</p>
|
||||||
|
<div class="mt15">
|
||||||
|
<button class="btn ulib-r20 bg-f8e26a block font-28 wp100 pt20 pb20"
|
||||||
|
v-if="val.enroll" @click="showEnroll(item.type,val)">
|
||||||
|
{{val.btnText}} {{val.limitText}}
|
||||||
|
</button>
|
||||||
|
<button class="btn ulib-r20 bg-f8e26a block font-28 wp100 pt20 pb20" v-else>
|
||||||
|
{{val.btnText}} {{val.limitText}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</van-swipe-item>
|
||||||
|
</van-swipe>
|
||||||
|
<div @click="bindCarPrev" class="absolute top-0 left-0 mt310 imgsize-60X60 ulib-r750 bds-1-ddd bg-fff">
|
||||||
|
<van-icon class="absolute box-center-middle" size="20" color="#ddd" name="arrow-left"></van-icon>
|
||||||
|
</div>
|
||||||
|
<div @click="bindCarNext" class="absolute top-0 right-0 mt310 imgsize-60X60 ulib-r750 bds-1-ddd bg-fff">
|
||||||
|
<van-icon class="absolute box-center-middle" size="20" color="#ddd" name="arrow"></van-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 图片模块 - 轮播 -->
|
||||||
|
<div class="card-module overflowhidden" style="padding: 0;"
|
||||||
|
v-if="item.type && item.type==3 && item.lists && item.lists.length>0">
|
||||||
|
<div class="swpier">
|
||||||
|
<van-swipe :autoplay="4000">
|
||||||
|
<van-swipe-item v-for="(val,key) in item.lists" :key="key">
|
||||||
|
<a :href="val.targetUrl">
|
||||||
|
<van-image :src="val.banner"></van-image>
|
||||||
|
</a>
|
||||||
|
</van-swipe-item>
|
||||||
|
</van-swipe>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 报名模块 - 一行两列 -->
|
||||||
|
<div class="pl30 pr30 relative" v-if="item.type && item.type==4 && item.lists && item.lists.length>0">
|
||||||
|
<div class="fn-flex fn-flex-wrap fn-flex-between">
|
||||||
|
<div class="wp48 text-center inner20 ulib-r20 bg-fff mb30" v-for="(val,key) in item.lists" :key="key">
|
||||||
|
<van-image :src="val.banner"></van-image>
|
||||||
|
<h3 class="font-34">{{val.title}}</h3>
|
||||||
|
<p class="ulib-r750 bg-f6 color-888 font-22 pt5 pb5 mt10">
|
||||||
|
<span>指导价</span><span class="ml5">{{val.subTitle}}</span>
|
||||||
|
</p>
|
||||||
|
<div class="mt50 ml30 mr30 relative" v-if="val.showBtn">
|
||||||
|
<span class="bg-f8e26a ulib-r750 font-20 pt5 pb5 pl10 pr10 absolute left-0 top-0"
|
||||||
|
style="margin-top:-3.5vw;">{{val.introduction}}</span>
|
||||||
|
<button class="btn ulib-r20 bg-000 color-fff block font-28 wp100 pt20 pb20"
|
||||||
|
@click="showEnroll(item.type,val)">
|
||||||
|
{{val.btnText}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 报名模块 - 一行一列 -->
|
||||||
|
<div class="card-module" style="padding-bottom: 0;"
|
||||||
|
v-if="item.type && item.type==5 && item.lists && item.lists.length>0">
|
||||||
|
<div :class="['fn-flex fn-flex-middle', 'pb30']" v-for="(val,key) in item.lists" :key="key">
|
||||||
|
<div class="wp25">
|
||||||
|
<van-image :src="val.banner"></van-image>
|
||||||
|
</div>
|
||||||
|
<div class="wp50 ml20 fn-flex fn-flex-center" style="flex-direction: column;">
|
||||||
|
<h3 class="font-32 text-nowrap">{{val.title}}</h3>
|
||||||
|
<p class="ulib-r750 color-888 font-22 mt10">
|
||||||
|
<span>指导价</span><span class="ml5">{{val.subTitle}}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="fn-flex-item" v-if="val.showBtn">
|
||||||
|
<button class="btn ulib-r20 bg-000 color-fff block font-28 wp100 pt20 pb20"
|
||||||
|
@click="showEnroll(item.type,val)">{{val.btnText}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 文章模块 -->
|
||||||
|
<div v-if="item.type && item.type==6 && item.lists && item.lists.length>0">
|
||||||
|
<template v-for="(val,key) in item.lists" :key="key">
|
||||||
|
<div class="card-module">
|
||||||
|
<div class="pt20 pb20">
|
||||||
|
<div>
|
||||||
|
<h3 class="font-36">{{val.title}}</h3>
|
||||||
|
<p class="color-aaa font-24 mt15">{{val.createTime}}</p>
|
||||||
|
</div>
|
||||||
|
<div class="font-28 mt30 color-666 line-height-15 color-555" v-html="val.introduction"></div>
|
||||||
|
|
||||||
|
<div class="mt60" v-if="0">
|
||||||
|
<div class="relative">
|
||||||
|
<a href=""><img src=""/></a>
|
||||||
|
<span class="bg-fff absolute left-0 bottom-0 color-666 font-20 op70 pt5 pb5 pl5 pr5">广告</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<aside class="fixed right-0 bottom-0 mr30 mb100 z-index-10">
|
||||||
|
<ul>
|
||||||
|
<li class="mt20" v-if="val.showBtn">
|
||||||
|
<div class="imgsize-120X120 relative" @click="showEnroll(item.type,val,1)">
|
||||||
|
<van-image
|
||||||
|
style="border: 0.6vw solid #ff3c3a;"
|
||||||
|
width="16vw"
|
||||||
|
height="16vw"
|
||||||
|
fit="cover"
|
||||||
|
round
|
||||||
|
:src="info.channelHeadImg"
|
||||||
|
></van-image>
|
||||||
|
<i class="absolute left-0 right-0 bottom-0 mb5 d-icon-9"></i>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="mt20">
|
||||||
|
<span @click="showEnroll(item.type,val)"><i class="inline-block d-icon-8"></i></span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</aside>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- 富文本模块 -->
|
||||||
|
<div v-if="0" class="card-module overflowhidden" style="padding:0;background-color: transparent;">
|
||||||
|
<div class="font-28 line-height-15 color-555" v-html="info.content"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 报名弹窗 - 中间显示 -->
|
||||||
|
<van-popup v-model="show_signup_center" :style="{ 'background-color': 'transparent' }">
|
||||||
|
<div class="card-module" style="width: 84vw;">
|
||||||
|
<div class="inner10">
|
||||||
|
<h3 class="text-center font-36 pt10 pb10">{{info.title}}</h3>
|
||||||
|
<div class="fn-flex fn-flex-center fn-flex-middle" v-if="showPopCarInfo">
|
||||||
|
<div class="wp33">
|
||||||
|
<van-image :src="popCarInfo.banner"></van-image>
|
||||||
|
</div>
|
||||||
|
<div class=" ml20 fn-flex fn-flex-center" style="flex-direction: column;">
|
||||||
|
<h3 class="font-32 text-nowrap">{{popCarInfo.title}}</h3>
|
||||||
|
<p class="ulib-r750 color-888 font-22 mt10"><span>指导价</span><span class="ml5">{{popCarInfo.subTitle}}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--顾问信息-->
|
||||||
|
<div class="fn-flex fn-flex-center fn-flex-middle" v-if="showPopChannel && info.channelName">
|
||||||
|
<div class=" ml20 fn-flex fn-flex-center" style="flex-direction: column;">
|
||||||
|
<p class="ulib-r750 color-888 font-30 mt10 mb10">
|
||||||
|
<span>专属顾问:</span><span class="ml5">{{info.channelName}}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-f1 ulib-r20 mb30">
|
||||||
|
<van-field v-model="form.name" label="" placeholder="请输入您的姓名"></van-field>
|
||||||
|
</div>
|
||||||
|
<div class="bg-f1 ulib-r20 mb30">
|
||||||
|
<van-field v-model="form.phone" label="" placeholder="请输入您的常用手机号"></van-field>
|
||||||
|
</div>
|
||||||
|
<div class="bg-f1 ulib-r20 mb30">
|
||||||
|
<van-field v-model="form.code" label="" placeholder="请输入手机验证码">
|
||||||
|
<template #button>
|
||||||
|
<p v-if="!show_retry" class="color-666 font-26" @click="getCode">发送验证码</p>
|
||||||
|
<van-count-down style="color:#999;" v-else :time="counttime" :auto-start="true"
|
||||||
|
format="ss 秒后重发" @finish="retrySend"/>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button class="btn ulib-r20 bg-f8e26a block font-30 wp100 pt20 pb20 mt50" @click="enroll">提交
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
<!-- 报名弹窗 - 底部显示 -->
|
||||||
|
<van-popup v-model="show_signup_bottom" position="bottom"
|
||||||
|
:style="{ 'min-height': '30%', 'background-color': 'transparent' }">
|
||||||
|
<div class="inner30 ulib-rt30 bg-fff" style="width: 100vw;margin:0;">
|
||||||
|
<div class="inner10">
|
||||||
|
<h3 class="text-center font-36 pt10 pb10">{{info.title}}</h3>
|
||||||
|
<div class="fn-flex fn-flex-center fn-flex-middle" v-if="showPopCarInfo">
|
||||||
|
<div class="wp33">
|
||||||
|
<van-image :src="popCarInfo.banner"></van-image>
|
||||||
|
</div>
|
||||||
|
<div class=" ml20 fn-flex fn-flex-center" style="flex-direction: column;">
|
||||||
|
<h3 class="font-32 text-nowrap">{{popCarInfo.title}}</h3>
|
||||||
|
<p class="ulib-r750 color-888 font-22 mt10"><span>指导价</span><span class="ml5">{{popCarInfo.subTitle}}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--顾问信息-->
|
||||||
|
<div class="fn-flex fn-flex-center fn-flex-middle" v-if="showPopChannel && info.channelName">
|
||||||
|
<div class=" ml20 fn-flex fn-flex-center" style="flex-direction: column;">
|
||||||
|
<p class="ulib-r750 color-888 font-30 mt10 mb10">
|
||||||
|
<span>专属顾问:</span><span class="ml5">{{info.channelName}}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-f1 ulib-r20 mb30">
|
||||||
|
<van-field v-model="form.name" label="" placeholder="请输入您的姓名"></van-field>
|
||||||
|
</div>
|
||||||
|
<div class="bg-f1 ulib-r20 mb30">
|
||||||
|
<van-field v-model="form.phone" label="" placeholder="请输入您的常用手机号"></van-field>
|
||||||
|
</div>
|
||||||
|
<div class="bg-f1 ulib-r20 mb30">
|
||||||
|
<van-field v-model="form.code" label="" placeholder="请输入手机验证码">
|
||||||
|
<template #button>
|
||||||
|
<p v-if="!show_retry" class="color-666 font-26" @click="getCode">发送验证码</p>
|
||||||
|
<van-count-down style="color:#999;" v-else :time="counttime" :auto-start="true"
|
||||||
|
format="ss 秒后重发" @finish="retrySend"/>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button class="btn ulib-r20 bg-f8e26a block font-30 wp100 pt20 pb20 mt50" @click="enroll">提交
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let app = new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
info: <?=json_encode($info)?>,
|
||||||
|
bg: '/img/h5/sytopic/bg.jpg',
|
||||||
|
modules: <?=$modules ? json_encode($modules, JSON_UNESCAPED_UNICODE) : '[]'?>,
|
||||||
|
car_swiper_index: 0,
|
||||||
|
show_signup_center: false,
|
||||||
|
show_signup_bottom: false,
|
||||||
|
form: {
|
||||||
|
name: '',
|
||||||
|
phone: '',
|
||||||
|
code: ''
|
||||||
|
},
|
||||||
|
showPopCarInfo: false,
|
||||||
|
showPopChannel: false,
|
||||||
|
popCarInfo: {
|
||||||
|
banner: '',
|
||||||
|
title: '',
|
||||||
|
subTitle: ''
|
||||||
|
},
|
||||||
|
isSubmiting: false,
|
||||||
|
optionId: 0,
|
||||||
|
counttime: 60000,
|
||||||
|
show_retry: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showEnroll(type, row, showPopChannel) {
|
||||||
|
this.showPopChannel = false
|
||||||
|
this.showPopCarInfo = false
|
||||||
|
let popUpType = row.popUpType ? parseInt(row.popUpType) : 0
|
||||||
|
if (parseInt(type) === 6) {
|
||||||
|
if (showPopChannel) {
|
||||||
|
this.showPopChannel = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.showPopCarInfo = true
|
||||||
|
this.popCarInfo.title = row.title
|
||||||
|
this.popCarInfo.subTitle = row.subTitle
|
||||||
|
this.popCarInfo.banner = row.banner
|
||||||
|
}
|
||||||
|
this.optionId = row.id
|
||||||
|
if (popUpType === 1) {
|
||||||
|
this.show_signup_bottom = true
|
||||||
|
} else {
|
||||||
|
this.show_signup_center = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCode() { //获取验证码
|
||||||
|
if (this.isSubmiting) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.form.phone) {
|
||||||
|
mDialog.msg({content: "请输入手机号"})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.isSubmiting = true
|
||||||
|
this.show_retry = true
|
||||||
|
this.counttime = 60000
|
||||||
|
var that = this;
|
||||||
|
$.post('/h5/market/sytopic/welcome/get_code', {
|
||||||
|
'mobile': this.form.phone,
|
||||||
|
'skey': '<?=$skey?>'
|
||||||
|
}, function (res) {
|
||||||
|
that.isSubmiting = false
|
||||||
|
mDialog.msg({
|
||||||
|
duration: 250,
|
||||||
|
pause: 2000,
|
||||||
|
content: res.msg
|
||||||
|
});
|
||||||
|
}, 'json');
|
||||||
|
},
|
||||||
|
retrySend() {
|
||||||
|
this.show_retry = false
|
||||||
|
},
|
||||||
|
enroll() {
|
||||||
|
if (this.isSubmiting) {
|
||||||
|
return false
|
||||||
|
} else if (!this.form.phone) {
|
||||||
|
mDialog.msg({content: "请输入手机号"})
|
||||||
|
} else if (!this.form.name) {
|
||||||
|
mDialog.msg({content: "请输入姓名"})
|
||||||
|
} else if (!this.form.code) {
|
||||||
|
mDialog.msg({content: "请输入验证码"})
|
||||||
|
} else {
|
||||||
|
this.isSubmiting = true
|
||||||
|
var that = this;
|
||||||
|
$.post('/h5/market/sytopic/welcome/enroll', {
|
||||||
|
'optionId': this.optionId,
|
||||||
|
'skey': '<?=$skey?>',
|
||||||
|
'info': this.form
|
||||||
|
}, function (res) {
|
||||||
|
that.isSubmiting = false
|
||||||
|
if (res.code == 200) {
|
||||||
|
that.show_signup_bottom = false
|
||||||
|
that.show_signup_center = false
|
||||||
|
that.form.phone = ''
|
||||||
|
that.form.name = ''
|
||||||
|
that.form.code = ''
|
||||||
|
}
|
||||||
|
mDialog.msg({
|
||||||
|
duration: 250,
|
||||||
|
pause: 2000,
|
||||||
|
content: res.msg
|
||||||
|
});
|
||||||
|
}, 'json');
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
bindCarNext() {
|
||||||
|
this.$refs.carswiper.next();
|
||||||
|
},
|
||||||
|
bindCarPrev() {
|
||||||
|
this.$refs.carswiper.prev();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/clipboard.min.js"></script>
|
||||||
|
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/html2canvas.min.js?v123"></script>
|
||||||
|
<body>
|
||||||
|
<div id="app" ref="app">
|
||||||
|
<div class="poster2">
|
||||||
|
<div class="detail-banner relative p-swiper">
|
||||||
|
<div class="swiper-container">
|
||||||
|
<div class="swiper-wrapper">
|
||||||
|
<div class="swiper-slide bg-size-cover" v-for="item in list">
|
||||||
|
<div class="relative">
|
||||||
|
<img class="wp100 block" style="pointer-events:none;" :src="item.img"/>
|
||||||
|
<div class="absolute left-0 right-0 bottom-0 mb30 text-center font-24"
|
||||||
|
:style="'color:'+fillStyle">{{posterTip}}
|
||||||
|
</div>
|
||||||
|
<img class="absolute right-0 bottom-0 mr40 mb80 imgsize-160X160"
|
||||||
|
style="pointer-events:none;" :src="item.code"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="swiper-pagination ulib-rl750"></div>
|
||||||
|
<div class="swiper-button-next"></div>
|
||||||
|
<div class="swiper-button-prev"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--
|
||||||
|
<div class="bts-1-eee inner30">
|
||||||
|
<div class="text-center">分享文案</div>
|
||||||
|
<div class="mt30 relative bds-1-eee inner30 pr200 ulib-r20 font-28" v-for="(item,index) in shareTx">
|
||||||
|
<span>{{item}}</span>
|
||||||
|
<a class="absolute right-0 box-middle mr30 inline-block pl30 pr30 line-height-17 bg-eee ulib-r750 J_copy" :data-clipboard-text="item">复制</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<div @click="showPoster">
|
||||||
|
<div style="height:70px;"></div>
|
||||||
|
<div class="fixed left-0 bottom-0 right-0 bg-000-op80 pt20 pb20 pl30 pr30 text-center z-index-4">
|
||||||
|
<button class="wp100 bg-fff border-none pt30 pb30 font-32 color-1a1a1a ulib-r10">生成海报</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="msg fn-hide" :style="msgisShowPoster?'display:block':'display:none'">
|
||||||
|
<div class="msgBgPoster" @click="closePoster"></div>
|
||||||
|
<div class="msgMain">
|
||||||
|
<i @click="closePoster" class="posterClose" v-if="posterSrc"><span></span></i>
|
||||||
|
<div class="msgPoster">
|
||||||
|
<div class="postercon overflowhidden ulib-r20">
|
||||||
|
<div style="display:none;">
|
||||||
|
<canvas id="canvas"></canvas>
|
||||||
|
</div>
|
||||||
|
<div v-if="posterSrc"><img class="wp100 ulib-r20" :src='posterSrc' alt=""/></div>
|
||||||
|
</div>
|
||||||
|
<div class="pt30 pb10 text-center text-center font-30 color-fff" v-if="posterSrc">
|
||||||
|
<img class="inline-block imgsize-42X42 text-middle"
|
||||||
|
src="https://qs.haodian.cn/web/images/project/H5-ShiYu/icon-finger.png" alt=""/>
|
||||||
|
<span class="ml10 text-middle">长按图片保存到手机发送给好友</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var app = new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data: {
|
||||||
|
list: <?=json_encode($lists, JSON_UNESCAPED_UNICODE)?>,
|
||||||
|
msgisShowPoster: false,
|
||||||
|
canW: 750,
|
||||||
|
canH: 0,
|
||||||
|
activeIndex: 0,
|
||||||
|
posterSrc: '',
|
||||||
|
posterTip: '<?=$posterTip?>',
|
||||||
|
fillStyle: '<?=$fillStyle?>',
|
||||||
|
shareTx: <?=json_encode($shareTitle, JSON_UNESCAPED_UNICODE)?>,
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
//复制文字
|
||||||
|
let clipboardDemos = new ClipboardJS('.J_copy');
|
||||||
|
clipboardDemos.on('success', function (e) {
|
||||||
|
e.clearSelection();
|
||||||
|
var msgDia = mDialog.msg({
|
||||||
|
duration: 250,
|
||||||
|
pause: 2000,
|
||||||
|
content: "复制成功!"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
let that = this
|
||||||
|
let swiper = new Swiper('.p-swiper .swiper-container', {
|
||||||
|
//loop: true,
|
||||||
|
autoHeight: true,
|
||||||
|
pagination: {
|
||||||
|
el: '.swiper-pagination',
|
||||||
|
type: 'fraction',
|
||||||
|
},
|
||||||
|
navigation: {
|
||||||
|
nextEl: '.swiper-button-next',
|
||||||
|
prevEl: '.swiper-button-prev',
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
slideChangeTransitionEnd: function () {
|
||||||
|
that.activeIndex = this.activeIndex
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showPoster: function () {
|
||||||
|
this.posterSrc = ''
|
||||||
|
this.draw()
|
||||||
|
},
|
||||||
|
closePoster: function () {
|
||||||
|
this.msgisShowPoster = false
|
||||||
|
},
|
||||||
|
|
||||||
|
//海报生成
|
||||||
|
draw() {
|
||||||
|
let that = this
|
||||||
|
let imgloading = mDialog.load({
|
||||||
|
shade: false,
|
||||||
|
text: "生成中...",
|
||||||
|
offset: ["35%", "40%"],
|
||||||
|
});
|
||||||
|
that.canH = that.list[that.activeIndex].height / that.list[that.activeIndex].width * that.canW
|
||||||
|
$("#canvas").attr({
|
||||||
|
'width': that.canW,
|
||||||
|
'height': that.canH,
|
||||||
|
});
|
||||||
|
let canvas = document.getElementById('canvas');
|
||||||
|
let ctx = canvas.getContext("2d");
|
||||||
|
let imgBg = new Image();
|
||||||
|
imgBg.setAttribute("crossOrigin", 'Anonymous')//如果二维码图片域名跨域,则保留此代码
|
||||||
|
imgBg.src = that.list[that.activeIndex].img
|
||||||
|
imgBg.onload = function () {
|
||||||
|
ctx.drawImage(imgBg, 0, 0, that.list[that.activeIndex].width, that.list[that.activeIndex].height, 0, 0, that.canW, that.canH)
|
||||||
|
let codeimg = new Image();
|
||||||
|
codeimg.setAttribute("crossOrigin", 'Anonymous')//如果二维码图片域名跨域,则保留此代码
|
||||||
|
codeimg.src = that.list[that.activeIndex].code
|
||||||
|
codeimg.onload = function () {
|
||||||
|
ctx.fillStyle = that.fillStyle;
|
||||||
|
ctx.textAlign = "center";
|
||||||
|
ctx.font = "24px Georgia";
|
||||||
|
ctx.fillText(that.posterTip, that.canW / 2, that.canH - 34,);
|
||||||
|
ctx.drawImage(codeimg, that.canW - 200, that.canH - 240, 160, 160)
|
||||||
|
setTimeout(function () {
|
||||||
|
that.posterSrc = canvas.toDataURL("image/jpg")
|
||||||
|
that.msgisShowPoster = true;
|
||||||
|
mDialog.close(imgloading);
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<?= $this->load->view('h5/market/sylive/share_script') ?>
|
||||||
|
</body>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<body class="bg-f6">
|
||||||
|
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
|
||||||
|
<div class="bg-f6" 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/mine-bg2.jpg)">
|
||||||
|
<div class="pt50 pl30 pr30 text-center">
|
||||||
|
<img class="bds-1-fff imgsize-120X120 ulib-r750" :src="info.logo" alt="#" />
|
||||||
|
<div class="pt10 font-36 text-center">{{info.title}}</div>
|
||||||
|
<div class="mt40"><img class="block wp100" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/mine-theme.png?v=230609" alt="尊享您的直播好礼" /></div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-fff ml30 mr30 pt20 pb20 pl40 pr40 ulib-r20 box-shadow-darkGray">
|
||||||
|
<a class="block relative pt30 pb30 bbs-1-eee last-b-none" :href="item.url" v-for="(item,index) in info.list">
|
||||||
|
<span class="font-32">{{item.title}}</span>
|
||||||
|
<i class="absolute box-middle right-0 iconfont icon-gengduo"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sytopic?skey=<?=$skey?>">
|
||||||
|
<i class="iconfont icon-shouye text-middle font-36"></i>
|
||||||
|
<div class="font-22">首页</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let hostUrl = ''
|
||||||
|
var app = new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data: {
|
||||||
|
info:{
|
||||||
|
list:[],
|
||||||
|
},//基础信息
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getInfo()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
//获取基础信息
|
||||||
|
getInfo(){
|
||||||
|
this.info = <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<?= $this->load->view('h5/market/sylive2/hidden_wx_share') ?>
|
||||||
|
</body>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
require_once APPPATH . 'controllers/api/BaseController.php';
|
||||||
|
|
||||||
|
class Enroll extends BaseController
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->load->model('market/Market_sytopic_model', 'mSytopic');
|
||||||
|
$this->load->model('market/Market_sytopic_enroll_model', 'sytopic_enroll_model');
|
||||||
|
$this->load->model('market/market_sylive_user_model', 'user_model');
|
||||||
|
$this->load->library('MyEncryption');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function page_get()
|
||||||
|
{
|
||||||
|
$page = $this->input_param('page');
|
||||||
|
$limit = $this->input_param('limit');
|
||||||
|
$sort = $this->input_param('sort');
|
||||||
|
$order = $this->input_param('order');
|
||||||
|
!$page && $page = 1;
|
||||||
|
!$limit && $limit = 10;
|
||||||
|
$sort_order = 'id desc';
|
||||||
|
if ($sort && $order) {
|
||||||
|
$sort_order = $sort . ' ' . $order;
|
||||||
|
}
|
||||||
|
$list = [];
|
||||||
|
$where['status>='] = 0;
|
||||||
|
$count = $this->sytopic_enroll_model->count($where);
|
||||||
|
if ($count) {
|
||||||
|
$res = $this->sytopic_enroll_model->select($where, $sort_order, $page, $limit);
|
||||||
|
$topicIds = array_column($res, 'topicId');
|
||||||
|
$topicIdsStr = implode(',', $topicIds);
|
||||||
|
$topicMap = [];
|
||||||
|
$topicIdsStr && $topicMap = $this->mSytopic->map('id', 'title', ["id in ({$topicIdsStr})" => null], '', '', '', 'id,title');
|
||||||
|
$channelUserIds = array_column($res, 'channelId');
|
||||||
|
$channelUserIdsStr = implode(',', array_unique($channelUserIds));
|
||||||
|
$channelUserMap = [];
|
||||||
|
$channelUserIdsStr && $channelUserMap = $this->user_model->map('userId', 'uname', ["userId in ({$channelUserIdsStr})" => null], '', '', '', 'userId,uname');
|
||||||
|
foreach ($res as $val) {
|
||||||
|
$val['channelName'] = $channelUserMap[$val['channelId']] ?: '';
|
||||||
|
$val['topicTitle'] = $topicMap[$val['topicId']] ?: '';
|
||||||
|
$val['status'] = intval($val['status']);
|
||||||
|
$list[] = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$date = ['list' => $list, 'count' => $count];
|
||||||
|
$this->return_response_list($date);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function status_get()
|
||||||
|
{
|
||||||
|
$statusArray = $this->sytopic_enroll_model->statusCn();
|
||||||
|
$this->return_response_list($statusArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改状态
|
||||||
|
*/
|
||||||
|
public function status_put()
|
||||||
|
{
|
||||||
|
$id = $this->input_param('id');
|
||||||
|
$status = $this->input_param('status');
|
||||||
|
if (!$id) {
|
||||||
|
$this->return_json('参数错误');
|
||||||
|
}
|
||||||
|
$this->sytopic_enroll_model->update(['status' => $status], ['id' => $id]);
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,253 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
require_once APPPATH . 'controllers/api/BaseController.php';
|
||||||
|
|
||||||
|
class Module extends BaseController
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->load->model('market/Market_sytopic_model', 'mSytopic');
|
||||||
|
$this->load->model('market/Market_sytopic_module_model', 'mSModule');
|
||||||
|
$this->load->model('market/Market_sytopic_module_option_model', 'mSModuleOption');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专题模块列表
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function page_get()
|
||||||
|
{
|
||||||
|
$topicId = intval($this->input_param('topicId'));
|
||||||
|
$page = $this->input_param('page');
|
||||||
|
$limit = $this->input_param('limit');
|
||||||
|
$title = $this->input_param('title');
|
||||||
|
$sort = $this->input_param('sort');
|
||||||
|
$order = $this->input_param('order');
|
||||||
|
!$page && $page = 1;
|
||||||
|
!$limit && $limit = 10;
|
||||||
|
$sort_order = 'sort desc,type asc';
|
||||||
|
if ($sort && $order) {
|
||||||
|
$sort_order = $sort . ' ' . $order;
|
||||||
|
}
|
||||||
|
$list = [];
|
||||||
|
$where = [
|
||||||
|
'topicId' => $topicId,
|
||||||
|
'status>=' => 0
|
||||||
|
];
|
||||||
|
$title && $where['title LIKE "%' . trim($title) . '%"'] = null;
|
||||||
|
$count = $this->mSModule->count($where);
|
||||||
|
if ($count) {
|
||||||
|
$res = $this->mSModule->select($where, $sort_order, $page, $limit);
|
||||||
|
$mSModule = new Market_sytopic_module_model();
|
||||||
|
foreach ($res as $v) {
|
||||||
|
$v['options'] = $this->mSModuleOption->count(['moduleId' => $v['id'], 'status' => 0]);
|
||||||
|
$v['type_cn'] = $mSModule::TYPE_ARRAY[$v['type']] ?: '';
|
||||||
|
$v['type'] = intval($v['type']);
|
||||||
|
$list[] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data = ['list' => $list, 'count' => $count];
|
||||||
|
$this->return_response_list($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加专题模块
|
||||||
|
*/
|
||||||
|
public function index_post()
|
||||||
|
{
|
||||||
|
$topicId = intval($this->input_param('topicId'));
|
||||||
|
$title = $this->input_param('title');
|
||||||
|
$type = $this->input_param('type');
|
||||||
|
$sort = intval($this->input_param('sort'));
|
||||||
|
if (!$topicId) {
|
||||||
|
$this->return_json('参数错误');
|
||||||
|
}
|
||||||
|
if (!$title) {
|
||||||
|
$this->return_json('请输入活动标题');
|
||||||
|
}
|
||||||
|
if (!$type) {
|
||||||
|
$this->return_json('请选择类型');
|
||||||
|
}
|
||||||
|
$createTime = date('Y-m-d H:i:s');
|
||||||
|
$addData = ['title' => $title, 'topicId' => $topicId, 'createTime' => $createTime, 'type' => $type, 'sort' => $sort ?: 0];
|
||||||
|
$topicId = $this->mSModule->add($addData);
|
||||||
|
if (!$topicId) {
|
||||||
|
$this->return_json('添加专题模块失败');
|
||||||
|
}
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改活动
|
||||||
|
*/
|
||||||
|
public function index_put()
|
||||||
|
{
|
||||||
|
$id = $this->input_param('id');
|
||||||
|
$title = $this->input_param('title');
|
||||||
|
$sort = intval($this->input_param('sort'));
|
||||||
|
if (!$title) {
|
||||||
|
$this->return_json('请输入活动标题');
|
||||||
|
}
|
||||||
|
$addData = ['title' => $title, 'sort' => $sort];
|
||||||
|
$topicId = $this->mSModule->update($addData, ['id' => $id]);
|
||||||
|
if (!$topicId) {
|
||||||
|
$this->return_json('修改专题失败');
|
||||||
|
}
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改状态
|
||||||
|
*/
|
||||||
|
public function status_put()
|
||||||
|
{
|
||||||
|
$id = $this->input_param('id');
|
||||||
|
$status = $this->input_param('status');
|
||||||
|
if (!$id) {
|
||||||
|
$this->return_json('参数错误');
|
||||||
|
}
|
||||||
|
$this->mSModule->update(['status' => $status], ['id' => $id]);
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除活动
|
||||||
|
*/
|
||||||
|
public function index_delete()
|
||||||
|
{
|
||||||
|
$ids = $this->input_param('ids');
|
||||||
|
if (!$ids) {
|
||||||
|
$this->return_json('参数错误');
|
||||||
|
}
|
||||||
|
$str_ids = is_array($ids) ? implode(',', $ids) : $ids;
|
||||||
|
if ($str_ids) {
|
||||||
|
$this->mSModule->update(['status' => -1], ["id in($str_ids)" => null]);
|
||||||
|
}
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型列表
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function types_get()
|
||||||
|
{
|
||||||
|
$mSModule = new Market_sytopic_module_model();
|
||||||
|
$list = [];
|
||||||
|
if ($mSModule::TYPE_ARRAY) {
|
||||||
|
foreach ($mSModule::TYPE_ARRAY as $key => $item) {
|
||||||
|
$list[] = [
|
||||||
|
'key' => $key,
|
||||||
|
'value' => $item
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data = ['list' => $list];
|
||||||
|
$this->return_response_list($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模块配置项
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function options_get()
|
||||||
|
{
|
||||||
|
$moduleId = $this->input_param('moduleId');
|
||||||
|
$moduleRow = $this->mSModule->get(['id' => $moduleId]);
|
||||||
|
if (!$moduleRow) $this->return_json('参数错误');
|
||||||
|
$where = [
|
||||||
|
'moduleId' => $moduleId,
|
||||||
|
'status' => 0
|
||||||
|
];
|
||||||
|
$rows = $this->mSModuleOption->select($where, 'id desc', 1, 1000);
|
||||||
|
$lists = [];
|
||||||
|
if ($rows) {
|
||||||
|
foreach ($rows as $item) {
|
||||||
|
$lists[] = $this->form_data($moduleRow, $item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['lists'] = $lists;
|
||||||
|
$this->return_response_list($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存模块配置项
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function options_post()
|
||||||
|
{
|
||||||
|
$postData = $this->input_param('');
|
||||||
|
$modelRow = $this->mSModule->get(['id' => $postData['moduleId']]);
|
||||||
|
if (!$modelRow) $this->return_json('参数错误');
|
||||||
|
if (!$postData['title']) $this->return_json('请输入标题');
|
||||||
|
$banner = $postData['banner'] ? $postData['banner'][0]['fileUrl'] : '';
|
||||||
|
$setOtherImg = '';
|
||||||
|
if ($postData['otherImg']) {
|
||||||
|
foreach ($postData['otherImg'] as $v) {
|
||||||
|
$setOtherImg[] = $v['fileUrl'];
|
||||||
|
}
|
||||||
|
$setOtherImg = json_encode($setOtherImg, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
$data = [
|
||||||
|
'title' => $postData['title'],
|
||||||
|
'banner' => $banner,
|
||||||
|
'subTitle' => $postData['subTitle'] ?: '',
|
||||||
|
'introduction' => $postData['introduction'] ?: '',
|
||||||
|
'showBtn' => $postData['showBtn'] ? 1 : 0,
|
||||||
|
'btnText' => $postData['btnText'] ?: '',
|
||||||
|
'popUpType' => $postData['popUpType'] ? 1 : 0,
|
||||||
|
'targetUrl' => $postData['targetUrl'] ?: '',
|
||||||
|
'otherImg' => $setOtherImg,
|
||||||
|
'enrollLimit' => $postData['enrollLimit'] ?: 0,
|
||||||
|
'enrollEndTime' => $postData['enrollEndTime'] ?: '0000-00-00 00:00:00'
|
||||||
|
];
|
||||||
|
if ($postData['id']) {
|
||||||
|
$result = $this->mSModuleOption->update($data, ['id' => $postData['id']]);
|
||||||
|
} else {
|
||||||
|
$data['topicId'] = $modelRow['topicId'];
|
||||||
|
$data['moduleId'] = $modelRow['id'];
|
||||||
|
$data['createTime'] = date('Y-m-d H:i:s', time());
|
||||||
|
$result = $this->mSModuleOption->add($data);
|
||||||
|
}
|
||||||
|
if (!$result) {
|
||||||
|
$this->return_json('操作失败');
|
||||||
|
}
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改状态
|
||||||
|
*/
|
||||||
|
public function options_delete()
|
||||||
|
{
|
||||||
|
$id = $this->input_param('id');
|
||||||
|
if (!$id) {
|
||||||
|
$this->return_json('参数错误');
|
||||||
|
}
|
||||||
|
$this->mSModuleOption->update(['status' => -1], ['id' => $id]);
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function form_data($moduleType, $row)
|
||||||
|
{
|
||||||
|
$otherImg = $jsondata = $banner = [];
|
||||||
|
if ($row['banner']) {
|
||||||
|
$banner = [['uid' => 1, 'fileUrl' => $row['banner'], 'url' => build_qiniu_image_url($row['banner']), 'status' => 'done']];
|
||||||
|
}
|
||||||
|
if ($row['otherImg']) {
|
||||||
|
$getOtherImg = json_decode($row['otherImg'], true);
|
||||||
|
foreach ($getOtherImg as $key => $val) {
|
||||||
|
$otherImg[] = ['uid' => $key, 'fileUrl' => $val, 'url' => build_qiniu_image_url($val), 'status' => 'done'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$row['otherImg'] = $otherImg;
|
||||||
|
if ($jsondata) {
|
||||||
|
$jsondata = json_decode($row['jsondata'], true);
|
||||||
|
}
|
||||||
|
$row['jsondata'] = $jsondata;
|
||||||
|
$row['banner'] = $banner;
|
||||||
|
$row['enrollEndTime'] = $row['enrollEndTime'] != '0000-00-00 00:00:00' ? $row['enrollEndTime'] : '';
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,227 @@
|
|||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
require_once APPPATH . 'controllers/api/BaseController.php';
|
||||||
|
|
||||||
|
class Topic extends BaseController
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->load->model('market/Market_sytopic_model', 'mSytopic');
|
||||||
|
$this->load->library('MyEncryption');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专题管理列表
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function page_get()
|
||||||
|
{
|
||||||
|
$page = $this->input_param('page');
|
||||||
|
$limit = $this->input_param('limit');
|
||||||
|
$title = $this->input_param('title');
|
||||||
|
$sort = $this->input_param('sort');
|
||||||
|
$order = $this->input_param('order');
|
||||||
|
!$page && $page = 1;
|
||||||
|
!$limit && $limit = 10;
|
||||||
|
$sort_order = 'id desc';
|
||||||
|
if ($sort && $order) {
|
||||||
|
$sort_order = $sort . ' ' . $order;
|
||||||
|
}
|
||||||
|
$list = [];
|
||||||
|
$where['status>='] = 0;
|
||||||
|
$title && $where['title LIKE "%' . trim($title) . '%"'] = null;
|
||||||
|
if ($_SESSION['brandName']) {//品牌机构
|
||||||
|
$re_org = $this->mdSyliveOrganization->get(['organizationName' => $_SESSION['brandName'], 'parentId' => 0, 'status' => 0]);
|
||||||
|
if ($re_org['organizationId']) {
|
||||||
|
$where['organizationId'] = $re_org['organizationId'];
|
||||||
|
} else {
|
||||||
|
$where['organizationId'] = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$count = $this->mSytopic->count($where);
|
||||||
|
if ($count) {
|
||||||
|
$this->load->library('MyEncryption');
|
||||||
|
$res = $this->mSytopic->select($where, $sort_order, $page, $limit);
|
||||||
|
foreach ($res as $v) {
|
||||||
|
$shareImg = $sharePhoto = $banner = [];
|
||||||
|
$jsonData = json_decode($v['jsondata'], true);
|
||||||
|
$jsonData['bg_color'] = $jsonData['bg_color'] ?: '';
|
||||||
|
if ($v['banner']) {
|
||||||
|
$banner = [['uid' => 1, 'fileUrl' => $v['banner'], 'url' => build_qiniu_image_url($v['banner']), 'status' => 'done']];
|
||||||
|
}
|
||||||
|
if ($v['sharePhoto']) {
|
||||||
|
$sharePhoto = [['uid' => 1, 'fileUrl' => $v['sharePhoto'], 'url' => build_qiniu_image_url($v['sharePhoto']), 'status' => 'done']];
|
||||||
|
}
|
||||||
|
if ($v['shareImg']) {
|
||||||
|
$getShareImg = json_decode($v['shareImg'], true);
|
||||||
|
foreach ($getShareImg as $k2 => $v2) {
|
||||||
|
$shareImg[] = ['uid' => $k2, 'fileUrl' => $v2, 'url' => build_qiniu_image_url($v2), 'status' => 'done'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($jsonData['banner']){
|
||||||
|
$jsonData['banner'] = [['uid' => 1, 'fileUrl' => $jsonData['banner'], 'url' => build_qiniu_image_url($jsonData['banner']), 'status' => 'done']];
|
||||||
|
}else{
|
||||||
|
$jsonData['banner'] = [];
|
||||||
|
}
|
||||||
|
$v['status'] = intval($v['status']);
|
||||||
|
$v['sharePhoto'] = $sharePhoto;
|
||||||
|
$v['banner'] = $banner;
|
||||||
|
$v['shareImg'] = $shareImg;
|
||||||
|
$v['organizationId'] = intval($v['organizationId']);
|
||||||
|
$v['dateRange'] = $v['timeStart'] ? [$v['timeStart'], $v['timeEnd']] : [];
|
||||||
|
$v['shareTitle'] = $v['shareTitle'] ? json_decode($v['shareTitle'], true) : [];
|
||||||
|
$v['json'] = $jsonData;
|
||||||
|
$list[] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$date = ['list' => $list, 'count' => $count];
|
||||||
|
$this->return_response_list($date);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function detail_get()
|
||||||
|
{
|
||||||
|
$id = $this->input_param('id');
|
||||||
|
$res = $this->mSytopic->get(['id' => $id]);
|
||||||
|
if (!$res) {
|
||||||
|
$this->return_json('参数错误');
|
||||||
|
}
|
||||||
|
$skey = $this->myencryption->base64url_encode("a_id=" . $res['id']);
|
||||||
|
$date = ['url' => http_host_com('home') . "/h5/market/sylive2?skey=" . $skey];
|
||||||
|
$this->return_response_list($date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加专题
|
||||||
|
*/
|
||||||
|
public function index_post()
|
||||||
|
{
|
||||||
|
$title = $this->input_param('title');
|
||||||
|
$dateRange = $this->input_param('dateRange');
|
||||||
|
$shareTitle = $this->input_param('shareTitle');
|
||||||
|
$shareImg = $this->input_param('shareImg');
|
||||||
|
$sharePhoto = $this->input_param('sharePhoto');
|
||||||
|
$organizationId = intval($this->input_param('organizationId'));
|
||||||
|
$banner = $this->input_param('banner');
|
||||||
|
$introduction = $this->input_param('introduction');
|
||||||
|
$jsonData = $this->input_param('json');
|
||||||
|
if (!$title) {
|
||||||
|
$this->return_json('请输入活动标题');
|
||||||
|
}
|
||||||
|
if (!$banner[0]['fileUrl']) {
|
||||||
|
$this->return_json('请选择banner图');
|
||||||
|
}
|
||||||
|
if (!$dateRange) {
|
||||||
|
$this->return_json('请选择活动时间');
|
||||||
|
}
|
||||||
|
$sharePhoto = $sharePhoto ? $sharePhoto[0]['fileUrl'] : '';
|
||||||
|
$banner = $banner ? $banner[0]['fileUrl'] : '';
|
||||||
|
$shareTitle = $shareTitle ? json_encode($shareTitle, JSON_UNESCAPED_UNICODE) : '';
|
||||||
|
$setShareImg = '';
|
||||||
|
if ($shareImg) {
|
||||||
|
foreach ($shareImg as $v) {
|
||||||
|
$setShareImg[] = $v['fileUrl'];
|
||||||
|
}
|
||||||
|
$setShareImg = json_encode($setShareImg, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
$setJsonData = [];
|
||||||
|
if ($jsonData['banner']) {
|
||||||
|
$setJsonData['banner'] = $jsonData['banner'] ? $jsonData['banner'][0]['fileUrl'] : '';
|
||||||
|
} else {
|
||||||
|
$setJsonData['banner'] = '';
|
||||||
|
}
|
||||||
|
$setJsonData['bg_color'] = $jsonData['bg_color'] ?: '';
|
||||||
|
$createTime = date('Y-m-d H:i:s');
|
||||||
|
$addData = ['title' => $title, 'banner' => $banner, 'status' => 1, 'createTime' => $createTime, 'organizationId' => $organizationId,
|
||||||
|
'sharePhoto' => $sharePhoto, 'shareTitle' => $shareTitle, 'timeStart' => $dateRange[0], 'timeEnd' => $dateRange[1], 'jsondata' => json_encode($setJsonData, JSON_UNESCAPED_UNICODE)];
|
||||||
|
$setShareImg && $addData['shareImg'] = $setShareImg;
|
||||||
|
$addData['introduction'] = $introduction ?: '';
|
||||||
|
$topicId = $this->mSytopic->add($addData);
|
||||||
|
if (!$topicId) {
|
||||||
|
$this->return_json('添加专题失败');
|
||||||
|
}
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改活动
|
||||||
|
*/
|
||||||
|
public function index_put()
|
||||||
|
{
|
||||||
|
$id = $this->input_param('id');
|
||||||
|
$title = $this->input_param('title');
|
||||||
|
$dateRange = $this->input_param('dateRange');
|
||||||
|
$shareTitle = $this->input_param('shareTitle');
|
||||||
|
$shareImg = $this->input_param('shareImg');
|
||||||
|
$sharePhoto = $this->input_param('sharePhoto');
|
||||||
|
$organizationId = intval($this->input_param('organizationId'));
|
||||||
|
$banner = $this->input_param('banner');
|
||||||
|
$introduction = $this->input_param('introduction');
|
||||||
|
$jsonData = $this->input_param('json');
|
||||||
|
if (!$title) {
|
||||||
|
$this->return_json('请输入活动标题');
|
||||||
|
}
|
||||||
|
if (!$banner[0]['fileUrl']) {
|
||||||
|
$this->return_json('请选择banner图');
|
||||||
|
}
|
||||||
|
if (!$dateRange) {
|
||||||
|
$this->return_json('请选择活动时间');
|
||||||
|
}
|
||||||
|
$sharePhoto = $sharePhoto ? $sharePhoto[0]['fileUrl'] : '';
|
||||||
|
$banner = $banner ? $banner[0]['fileUrl'] : '';
|
||||||
|
$shareTitle = $shareTitle ? json_encode($shareTitle, JSON_UNESCAPED_UNICODE) : '';
|
||||||
|
$setShareImg = '';
|
||||||
|
if ($shareImg) {
|
||||||
|
foreach ($shareImg as $v) {
|
||||||
|
$setShareImg[] = $v['fileUrl'];
|
||||||
|
}
|
||||||
|
$setShareImg = json_encode($setShareImg, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
$setJsonData = [];
|
||||||
|
if ($jsonData['banner']) {
|
||||||
|
$setJsonData['banner'] = $jsonData['banner'] ? $jsonData['banner'][0]['fileUrl'] : '';
|
||||||
|
} else {
|
||||||
|
$setJsonData['banner'] = '';
|
||||||
|
}
|
||||||
|
$setJsonData['bg_color'] = $jsonData['bg_color'] ?: '';
|
||||||
|
$addData = ['title' => $title, 'banner' => $banner, 'status' => 1, 'organizationId' => $organizationId, 'sharePhoto' => $sharePhoto,
|
||||||
|
'shareTitle' => $shareTitle, 'timeStart' => $dateRange[0], 'timeEnd' => $dateRange[1], 'jsondata' => json_encode($setJsonData, JSON_UNESCAPED_UNICODE)];
|
||||||
|
$setShareImg && $addData['shareImg'] = $setShareImg;
|
||||||
|
$addData['introduction'] = $introduction ?: '';
|
||||||
|
$topicId = $this->mSytopic->update($addData, ['id' => $id]);
|
||||||
|
if (!$topicId) {
|
||||||
|
$this->return_json('修改专题失败');
|
||||||
|
}
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改状态
|
||||||
|
*/
|
||||||
|
public function status_put()
|
||||||
|
{
|
||||||
|
$id = $this->input_param('id');
|
||||||
|
$status = $this->input_param('status');
|
||||||
|
if (!$id) {
|
||||||
|
$this->return_json('参数错误');
|
||||||
|
}
|
||||||
|
$this->mSytopic->update(['status' => $status], ['id' => $id]);
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除活动
|
||||||
|
*/
|
||||||
|
public function index_delete()
|
||||||
|
{
|
||||||
|
$ids = $this->input_param('ids');
|
||||||
|
if (!$ids) {
|
||||||
|
$this->return_json('参数错误');
|
||||||
|
}
|
||||||
|
$str_ids = is_array($ids) ? implode(',', $ids) : $ids;
|
||||||
|
if ($str_ids) {
|
||||||
|
$this->mSytopic->update(['status' => -1], ["id in($str_ids)" => null]);
|
||||||
|
}
|
||||||
|
$this->return_response();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 584 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 9.1 KiB |