admin_topic_328_2

This commit is contained in:
dengbw
2023-03-28 11:11:31 +08:00
committed by lccsw
parent b0b8877983
commit b5814bef1a
11 changed files with 774 additions and 448 deletions
+40 -20
View File
@@ -4,13 +4,6 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class CluesCfrom extends HD_Controller
{
private $tabAry = [
1 => ['title' => '客户标签', 'url' => '/receiver/tag'],
2 => ['title' => '车主标签', 'url' => '/receiver/ownersTag'],
3 => ['title' => '战败标签', 'url' => '/receiver/tag?tag_type=1'],
4 => ['title' => '意向标签', 'url' => '/receiver/tag?tag_type=2']
];
public function __construct()
{
parent::__construct();
@@ -35,17 +28,20 @@ class CluesCfrom extends HD_Controller
$where['status'] = $params['status'];
}
if ($params['title']) {
$where['title'] = $params['title'];
$where["title like '%{$params['title']}%'"] = null;
}
$count = $this->mdCluesCfrom->count($where);
if ($count) {
$res = $this->mdCluesCfrom->select($where, "c_time desc", $params['page'], $params['size']);
$res = $this->mdCluesCfrom->select($where, "sort desc,id desc", $params['page'], $params['size']);
foreach ($res as $key => $value) {
$setValue = [];
$setValue['id'] = $value['id'];
$setValue['name'] = $value['title'];
$setValue['sort'] = $value['sort'];
$setValue['status'] = $value['status'];
$setValue['status_name'] = $value['status'] == 1 ? '正常' : '禁用';
$options = '';
$res_cfrom = $this->mdCluesCfrom->select(["status<>" => -1, 'pid' => $value['id']], "c_time desc", 0, 0, 'title');
$res_cfrom = $this->mdCluesCfrom->select(["status<>" => -1, 'pid' => $value['id']], "sort desc,c_time desc", 1, 10, 'title');
$res_cfrom && $options = implode(',', array_column($res_cfrom, 'title'));
$setValue['options'] = $options;
$lists[] = $setValue;
@@ -53,7 +49,7 @@ class CluesCfrom extends HD_Controller
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = '线索来源列表';
$this->data['_title'] = '线索来源';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('receiver/cluescfrom/lists', true);
}
@@ -64,7 +60,7 @@ class CluesCfrom extends HD_Controller
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$res_tag = $this->mdCluesCfrom->select(["status" => 1, 'pid' => $id], "c_time desc", 0, 0, 'title as name');
$res_tag = $this->mdCluesCfrom->select(["status" => 1, 'pid' => $id], "sort desc,id desc", 0, 0, 'id,title as name,sort,status');
$this->data['lists'] = $res_tag;
return $this->show_json(SYS_CODE_SUCCESS);
}
@@ -80,11 +76,13 @@ class CluesCfrom extends HD_Controller
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$name = $re['title'];
$sort = $re['sort'];
} else {
$url = "receiver/CluesCfrom/add";
$sort = 50;
$name = '';
}
$this->data['showInfo'] = ['id' => $id, 'name' => $name, 'url' => $url];
$this->data['showInfo'] = ['id' => $id, 'name' => $name, 'sort' => $sort, 'url' => $url];
return $this->show_view('receiver/cluescfrom/edit');
}
@@ -95,11 +93,11 @@ class CluesCfrom extends HD_Controller
if (!$params['name']) {
return $this->show_json(SYS_CODE_FAIL, '名称不能为空!');
}
$re = $this->mdCluesCfrom->get(['name' => $params['name'], 'pid' => 0, "status<>" => -1]);
$re = $this->mdCluesCfrom->get(['title' => $params['name'], 'pid' => 0, "status<>" => -1]);
if ($re) {
return $this->show_json(SYS_CODE_FAIL, '名称已存在了!');
}
$id = $this->mdCluesCfrom->add(['name' => $params['name'], 'c_time' => time()]);
$id = $this->mdCluesCfrom->add(['title' => $params['name'], 'sort' => $params['sort'], 'c_time' => time()]);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
@@ -116,11 +114,11 @@ class CluesCfrom extends HD_Controller
if (!$params['name']) {
return $this->show_json(SYS_CODE_FAIL, '请输入名称');
}
$re = $this->mdCluesCfrom->get(array('name' => $params['name'], 'pid' => 0, "status<>" => -1));
$re = $this->mdCluesCfrom->get(array('title' => $params['name'], 'pid' => 0, "status<>" => -1));
if ($re && $re['id'] != $params['id']) {
return $this->show_json(SYS_CODE_FAIL, '名称已存在了!');
}
$this->mdCluesCfrom->update(['name' => $params['name']], ['id' => $params['id']]);
$this->mdCluesCfrom->update(['title' => $params['name'], 'sort' => $params['sort']], ['id' => $params['id']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
@@ -151,15 +149,15 @@ class CluesCfrom extends HD_Controller
if (!$re) {
return $this->show_json(SYS_CODE_FAIL, '数据不存在!');
}
$add_tag = $edit_tag = [];
foreach ($options as $key => $value) {
$data = ['name' => $value['name'], 'status' => $value['status']];
$sort = intval($value['sort']);
$data = ['title' => $value['name'], 'status' => $value['status'], 'sort' => $sort];
if ($value['name']) {
if ($value['id']) {//修改
$this->mdCluesCfrom->update($data, ['id' => $value['id']]);
} else {//新增
$add_tag[] = ['name' => $value['name'], 'c_time' => time()];
$data['pid'] = $pid;
$data['c_time'] = time();
$this->mdCluesCfrom->add($data);
}
}
@@ -178,6 +176,28 @@ class CluesCfrom extends HD_Controller
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
}
/**
* Notes:获取分类信息
* Created on: 2023/3/27 17:39
* Created by: dengbw
* @return bool
*/
function json_get()
{
$id = $this->input->get('id');
$where = [
'status' => 1,
'pid' => 0
];
$id && $where['pid'] = $id;
if ($this->role == 37) {
!$id && $where['id'] = 36;
}
$rows = $this->mdCluesCfrom->select($where, 'sort desc,id desc', '', '', 'id,title');
$this->data['data'] = $rows;
return $this->show_json(SYS_CODE_SUCCESS);
}
//批量操作(默认修改状态)
public function batch()
{
+62 -231
View File
@@ -1,22 +1,19 @@
<?php
/**
* Notes:报名管理
* Created on: 2020/5/18 12:45
* Created on: 2023/3/27 12:45
* Created by: dengbw
* @return bool
*/
Class Enroll extends HD_Controller
{
private $statusAry = array(-1 => '已失效', 0 => '未核销', 1 => '已核销');
public function __construct()
{
parent::__construct();
$this->load->model('topics/topics_model', 'mdTopics');
$this->load->model('topics/topic_modules_model', 'mdTopicModules');
$this->load->model('topics/topic_module_enroll_model', 'mdModuleEnroll');
$this->load->model('topics/topic_module_enrolldata_model', 'mdModuleEnrolldata');
$this->load->model('topics/topic_enroll_model', 'mdEnroll');
$this->load->model('receiver/receiver_clues_cfrom_model', 'mdCluesCfrom');
}
public function index()
@@ -29,182 +26,81 @@ Class Enroll extends HD_Controller
$params = $this->input->get();
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$params['module_id'] = intval($params['module_id']);
$params['id'] = intval($params['id']);
$res = $this->dataSelect($params);
if ($res['code'] == 0) {
return $this->show_json(SYS_CODE_FAIL, $res['msg']);
}
$lists = $res['lists'];
$count = $res['count'];
$this->data['params'] = $res['params'];
$this->data['_title'] = $res['title'] . '列表';
$this->data['type'] = $res['type'];
$this->data['statusAry'] = $this->statusAry;
$this->data['_title'] = $res['title'];
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
return $this->show_view('topics/enroll/lists', true);
}
/**
* 报名活动列表
* @return bool
*/
public function lists_module()
{
$params = $this->input->get();
$page = $params['page'] ? $params['page'] : 1;
$size = $params['size'] ? $params['size'] : 20;
$app_id = $params['app_id'];
$search_ary = array("title" => "标题", "module_id" => "ID");
//根据应用获取模块
$where = array('app_id' => $app_id);
$rows_topic = $this->mdTopics->select($where);
$module_ids = array();
if ($rows_topic) {
foreach ($rows_topic as $v) {
if ($v['module_ids']) {
$ids = explode(',', $v['module_ids']);
if ($ids) {
$module_ids = array_merge($module_ids, $ids);
}
}
}
}
$total = 0;
$lists = array();
if ($module_ids) {
$str_ids = implode(',', $module_ids);
$where = array("module_id in ({$str_ids})" => null);
if ($params['search_v']) {
if ('title' == $params['search_k']) {
$where["m.title like '%{$params['search_v']}%'"] = null;
} else {
$where["m.{$params['search_k']}"] = $params['search_v'];
}
}
!$params['search_k'] && $params['search_k'] = 'title';
if (strlen($params['status']) > 0) {
$where['j.status'] = $params['status'];
} else {
$where['j.status>=0'] = null;
$params['status'] = '';
}
$total = $this->mdModuleEnroll->count_status($where);
if ($total) {
$orderby = 'id desc';
$select = "module_id, title, es_time, ee_time, as_time, ae_time, j.status";
$rows = $this->mdModuleEnroll->select_status($where, $orderby, $page, $size, $select);
foreach ($rows as $v) {
$lists[] = array(
'id' => $v['module_id'],
'title' => $v['title'],
'e_time' => "{$v['es_time']}~{$v['ee_time']}",
'a_time' => "{$v['as_time']}~{$v['ae_time']}",
'status' => $v['status'],
'statusion' => 1 == $v['status'] ? "正常" : "下架",
);
}
}
}
$this->data['params'] = $params;
$this->data['lists'] = $lists;
$this->data['search_ary'] = $search_ary;
$this->data['_title'] = '报名活动管理';
$this->data['pager'] = array('count' => ceil($total / $size), 'curr' => $page, 'totle' => $total);
return $this->show_view('topics/enroll/lists_module', true);
return $this->show_view('topics/lists_enroll', true);
}
/**
* Notes:查找报名数据
* Created on: 2020/5/19 16:37
* Created on: 2023/3/27 16:37
* Created by: dengbw
* @param $params
* @return array
*/
private function dataSelect($params)
{
$where = $lists = array();
$title = '活动报名';
$type = 0;
if ($params['module_id']) {
$where['module_id'] = $params['module_id'];
$row_en = $this->mdModuleEnroll->get(array('module_id' => $params['module_id']), 'title,type');
$title = $row_en['title'];
$type = $row_en['type'];
} else {
//根据应用获取报名列表
$app_id = $params['app_id'];
$where_topic = array('app_id' => $app_id);
$rows_topic = $this->mdTopics->select($where_topic);
$module_ids = array();
if ($rows_topic) {
foreach ($rows_topic as $v) {
if ($v['module_ids']) {
$ids = explode(',', $v['module_ids']);
if ($ids) {
$module_ids = array_merge($module_ids, $ids);
}
}
}
}
if ($module_ids) {
$str_ids = implode(',', $module_ids);
$where["module_id in ({$str_ids})"] = null;
} else {
$where['module_id'] = -1;
}
}
if (status_verify($params['status'])) {
$where['status'] = $params['status'];
} else {
$params['status'] = -99;
}
if ($params['name']) {
$where['name like "%' . $params['name'] . '%"'] = null;
$where['topics_id'] = $params['id'];
if ($params['nickname']) {
$where['nickname like "%' . $params['nickname'] . '%"'] = null;
}
if ($params['mobile']) {
$where['mobile'] = $params['mobile'];
}
if ($params['code']) {
$where['code'] = $params['code'];
if ($params['cfrom_id'] || $params['cfrom_id2']) {
if ($params['cfrom_id2']) {
$where['cf_id'] = $params['cfrom_id2'];
} else {
$cf_rows = $this->mdCluesCfrom->select(['pid' => $params['cfrom_id']], '', '', '', 'id');
$cf_ids = array_column($cf_rows, 'id');
$cf_ids[] = $params['cfrom_id'];
$cf_str_ids = implode(',', array_filter($cf_ids));
$cf_str_ids && $where["cf_id in ({$cf_str_ids})"] = null;
}
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where["c_time >="] = strtotime($time[0] . ' 00:00:00');
$time[1] && $where["c_time <="] = strtotime($time[1] . ' 23:59:59');
}
$count = $this->mdModuleEnrolldata->count($where);
$lists = [];
$count = $this->mdEnroll->count($where);
if ($count) {
$select = "id,module_id,name,mobile,code,status,c_time,jsondata";
$lists = $this->mdModuleEnrolldata->select($where, "id desc", $params['page'], $params['size'], $select);
$map_module = array();
if ($lists) {
$module_ids = array_unique(array_column($lists, 'module_id'));
$str_ids = implode(',', $module_ids);
$where_module = array("module_id in ({$str_ids})" => null);
$map_module = $this->mdModuleEnroll->map('module_id', '*', $where_module, '', 0, 0, 'module_id, title, descrip');
$res = $this->mdEnroll->select($where, "id desc", $params['page'], $params['size']);
//获取来源
$map_cf_pid = $cf_title_arr = [];
$cf_id_arr = array_unique(array_column($res, 'cf_id'));
if ($cf_id_arr) {
$cf_id_str = implode(',', $cf_id_arr);
$res_cfrom = $this->mdCluesCfrom->select(["id in({$cf_id_str})" => null], 'id desc', 0, 0, 'id,title,pid');
$cf_pid_arr = array_unique(array_column($res_cfrom, 'pid'));
if ($cf_pid_arr) {
$cf_pid_str = implode(',', $cf_pid_arr);
$map_cf_pid = $this->mdCluesCfrom->map('id', 'title', ["id in({$cf_pid_str})" => null]);
}
foreach ($res_cfrom as $key => $val) {
$title = $val['title'];
if ($val['pid']) {//一级分类
$map_cf_pid[$val['pid']] && $title = $map_cf_pid[$val['pid']] . '-' . $title;
}
$cf_title_arr[$val['id']] = $title;
}
}
foreach ($lists as $key => $value) {
$json = json_decode($value['jsondata'], true);
$module = $map_module[$value['module_id']];
$lists[$key]['c_time'] = date('Y-m-d H:i', $value['c_time']);
$lists[$key]['status_name'] = $this->statusAry[$value['status']];
$lists[$key]['remark'] = $json['remark'] ? $json['remark'] : '';
$lists[$key]['title'] = $module['descrip'] ? $module['descrip'] : $module['title'];
foreach ($res as $k => $v) {
$cf_name = $cf_title_arr[$v['cf_id']] ? $cf_title_arr[$v['cf_id']] : '-';
$c_time = date('Y-m-d H:i', $v['c_time']);
$lists[] = ['id' => $v['id'],'nickname' => $v['nickname'], 'mobile' => $v['mobile']
, 'cf_name' => $cf_name, 'c_time' => $c_time];
}
}
$data['code'] = SYS_CODE_SUCCESS;
$data['type'] = $type;
$re = $this->mdTopics->get(['id' => $params['id']]);
$title = $re['title'] ? $re['title'] . '_报名列表' : '专题报名列表';
$data['title'] = $title;
$data['lists'] = $lists;
$data['count'] = $count;
@@ -214,30 +110,6 @@ Class Enroll extends HD_Controller
public function get()
{
$id = intval($this->input->get('id'));
$module_id = intval($this->input->get('module_id'));
if (!$id || !$module_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$re = $this->mdModuleEnrolldata->get(array("id" => $id));
if (!$re || empty($re)) {
return $this->show_json(SYS_CODE_FAIL, '报名详情不存在!');
}
$reEn = $this->mdModuleEnroll->get(array('module_id' => $module_id), 'enroll_json,type');
$enroll_json = array();
if ($reEn['enroll_json'] && $re['jsondata']) {
$enroll_json = json_decode($reEn['enroll_json'], true);
$jsondata = json_decode($re['jsondata'], true);
foreach ($enroll_json as $key => $value) {
$jsondata[$key] && $enroll_json[$key]['value'] = $jsondata[$key];
}
}
$re['enroll_json'] = $enroll_json;
$re['type'] = $reEn['type'];
$re['c_time'] = date('Y-m-d H:i', $re['c_time']);
$re['status_name'] = $this->statusAry[$re['status']];
$this->data['info'] = $re;
return $this->show_view('topics/enroll/edit');
}
public function del()
@@ -255,63 +127,22 @@ Class Enroll extends HD_Controller
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
$params['export'] = 1;
$data = $indexs = array();
$data = $indexs = [];
$res = $this->dataSelect($params);
if ($params['module_id']) {
if ($params['type'] == 1) {
$fileName = '活动报名用户';
foreach ($res['lists'] as $key => $value) {
$temp['name'] = $value['name'];
$temp['mobile'] = $value['mobile'];
$temp['code'] = $value['code'];
$temp['status_name'] = $value['status_name'];
$temp['c_time'] = $value['c_time'];
$temp['remark'] = $value['remark'];
$data[] = $temp;
}
$indexs = [
'name' => '姓名',
'mobile' => '手机号',
'code' => '核销码',
'status_name' => '状态',
'c_time' => '报名时间',
"remark" => "备注",
];
} else {
$fileName = '报名用户';
foreach ($res['lists'] as $key => $value) {
$temp['name'] = $value['name'];
$temp['mobile'] = $value['mobile'];
$temp['c_time'] = $value['c_time'];
$temp['remark'] = $value['remark'];
$data[] = $temp;
}
$indexs = [
'name' => '姓名',
'mobile' => '手机号',
'c_time' => '报名时间',
"remark" => "备注",
];
}
} else {
$fileName = '活动报名';
foreach ($res['lists'] as $key => $value) {
$temp['title'] = $value['title'];
$temp['name'] = $value['name'];
$temp['mobile'] = $value['mobile'];
$temp['c_time'] = $value['c_time'];
$temp['remark'] = $value['remark'];
$data[] = $temp;
}
$indexs = [
'title' => '活动名称',
'name' => '姓名',
'mobile' => '手机号',
'c_time' => '报名时间',
"remark" => "备注",
];
$fileName = $res['title'];
foreach ($res['lists'] as $key => $value) {
$temp['nickname'] = $value['nickname'];
$temp['mobile'] = $value['mobile'];
$temp['cf_name'] = $value['cf_name'];
$temp['c_time'] = $value['c_time'];
$data[] = $temp;
}
$indexs = [
'nickname' => '昵称',
'mobile' => '手机号',
"cf_name" => "来源",
'c_time' => '报名时间',
];
array_unshift($data, $indexs);
$this->load->library('excel');
$this->excel->out_csv($data, $indexs, $fileName . "_" . date('YmdHis'));
+4 -4
View File
@@ -300,11 +300,11 @@
},
getCfroms: function () {
var that = this
$.get('/receiver/clues/get_cfroms', function (result) {
$.get('/receiver/CluesCfrom/json_get', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
$.get('/receiver/clues/get_cfroms', {'id': that.cfrom_id}, function (result) {
$.get('/receiver/CluesCfrom/json_get', {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
@@ -350,9 +350,9 @@
var that = this;
if (nv == '') {
that.cfrom_id2 = 0;
that.cfroms = [];
that.cfroms2 = [];
} else {
$.get('/receiver/clues/get_cfroms', {'id': nv}, function (result) {
$.get('/receiver/CluesCfrom/json_get', {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
+3 -14
View File
@@ -2,26 +2,15 @@
method="post" style="width: 90%;padding-top: 10px" onsubmit="return false">
<input type="hidden" value="<?= $showInfo['id'] ?>" name="id"/>
<div class="am-form-group">
<label class="am-para-label">名称:</label>
<label class="am-para-label">分类名称:</label>
<div class="am-para-input">
<input type="text" placeholder="输入名称" value="<?= $showInfo['name'] ?>" name="name"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">选项类型:</label>
<div class="am-para-input" style="width: 30%">
<select name="type">
<? foreach ($showInfo['typeAry'] as $key => $value) { ?>
<option value="<?= $key ?>" <?= $key == $showInfo['type'] ? 'selected' : '' ?>
><?= $value ?></option>
<? } ?>
</select>
<input type="text" placeholder="输入分类名称" value="<?= $showInfo['name'] ?>" name="name"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">排序:</label>
<div class="am-para-input" style="width: 30%">
<input type="text" placeholder="输入排序" value="<?= $showInfo['sort'] ?>" name="sort"/>
<input type="number" placeholder="输入排序" value="<?= $showInfo['sort'] ?>" name="sort"/>
<small class="text-muted">越大越靠前</small>
</div>
</div>
+411 -166
View File
@@ -1,225 +1,470 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<div id="recom-stat"></div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="<?= !strlen($params['status']) ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/receiver/clues">全部</a>
</li>
<? foreach ($statusList as $v) { ?>
<li role="presentation"
class="<? if (strlen($params['status']) && $params['status'] == $v['id']) { ?>active<? } ?>">
<? if ($v['cate']) { ?>
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
<?= $v['name'] ?>
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
</a>
<ul class="dropdown-menu">
<? if ($v['cate']) { ?>
<li class="<?= $params['status'] == $v['id'] && !$params['status2'] ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="/receiver/clues?status=<?= $v['id'] ?>">
全部
</a>
</li>
<? } ?>
<? foreach ($v['cate'] as $v2) { ?>
<li class="<?= $params['status2'] == $v2['id'] ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="/receiver/clues?status=<?= $v['id'] ?>&status2=<?= $v2['id'] ?>">
<?= $v2['name'] ?>
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
</a>
</li>
<? } ?>
</ul>
<? } else { ?>
<a href="javascript:void (0);"
data-open="/receiver/clues?status=<?= $v['id'] ?>">
<?= $v['name'] ?>
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
</a>
<? } ?>
</li>
<? } ?>
</ul>
</div>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="receiver/ownersTag">
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/receiver/clues" id="search_form">
<input name="status" value="<?= $params['status'] ?>" type="hidden">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">类型:</label>
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="type">
<option value="">选择类型</option>
<? foreach ($showInfo['typeAry'] as $key => $value) { ?>
<option value="<?= $key ?>" <?= $key == $params['type'] ? 'selected' : '' ?>
><?= $value ?></option>
<select name="search_tp" id="search_tp">
<? foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl ml30">
<div class="am-form-group fl">
<div class="am-para-inline w260">
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">报名位置:</label>
<div class="am-form-group am-para-inline w150">
<select name="city_id" v-model="city_id">
<option value="0">城市</option>
<template v-for="(v,i) in cityAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="county_id" v-model="county_id">
<option value="0">行政区</option>
<template v-for="(v,i) in countyAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">线索来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<label class="am-para-label w100">创建时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
placeholder="创建时间范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today"
data-source="id-create-time">今日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
data-source="id-create-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
data-source="id-create-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
data-source="id-create-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<label class="am-para-label w100">最后报名时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-en-time" name="en_time" type="text" value="<?= $params['en_time'] ?>"
placeholder="创建时间范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today"
data-source="id-en-time">今天</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
data-source="id-en-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
data-source="id-en-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
data-source="id-en-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button data-modal="/receiver/ownersTag/get" type="button" data-title="新增标签"
class="am-btn am-btn-success am-btn-sm w100">
新增
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
onclick="edit_adviser();">分配
</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
data-modal="/receiver/clues/get_add" data-title="新增线索">新增
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd" id="vue-show">
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="25%"><span>名称</span></th>
<th width="45%"><span>标签选项</span></th>
<th width="7%"><span>类型</span></th>
<th width="5%"><span>排序</span></th>
<th width="5%"><span>状态</span></th>
<th width="3%"><label class="checkall">
<input type="checkbox" data-check-target=".order-ids"> 全选</label></th>
<th width="5%"><span>客户姓名</span></th>
<th width="5%"><span>客户电话</span></th>
<th width="8%"><span>线索来源</span></th>
<th width="8%"><span>状态</span></th>
<th width="4%"><span>跟进人</span></th>
<th width="7%"><span>创建时间</span></th>
<th width="7%"><span>最后报名时间</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
<? if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><input type="checkbox" name="ids[]" class="order-ids"
value="<?= $v['id'] ?>"/></td>
<td><?= $v['name'] ?></td>
<td><?= $v['options'] ?></td>
<td><?= $v['type_name'] ?></td>
<td><?= $v['sort'] ?></td>
<td><?= $v['status_name'] ?></td>
<td><?= $v['mobile_sub'] ?></td>
<td><?= $v['cf_title'] ?></td>
<td><? if ($v['cf_id'] == 36 || $v['cf_id'] == 37) { ?>
<input type="hidden" class="clues-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>"
checked>
<select data-update-group="" data-list-target=".clues-id-<?= $v['id'] ?>"
data-action="/receiver/clues/batch" data-field=""
style="height: 26px;width: 100px;">
<? foreach ($maintainAry as $key => $val) { ?>
<option value="<?= $key ?>" <?= $key == $v['status'] . '-' . $v['status2'] ? 'selected' : '' ?>><?= $val ?></option>
<? } ?>
</select>
<? } else { ?>
<?= $v['status_name'] ?>
<? } ?>
</td>
<td><?= $v['admin_name'] ?></td>
<td><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
<td><?= $v['en_time'] ?></td>
</tr>
<tr>
<td colspan="5" class="align-r">
<a href="javascript:void(0);" @click="optionsModal(<?= $v['id'] ?>,'<?= $v['name'] ?>')"
class="am-btn am-btn-primary am-btn-xs">编辑选项</a>
<a href="javascript:void(0);" data-modal="/receiver/ownersTag/get?id=<?= $v['id'] ?>"
data-title="编辑标签" class="am-btn am-btn-primary am-btn-xs">编辑标签</a>
<? if ($v['status'] == 1) { ?>
<a data-ajax="post" data-action="/receiver/ownersTag/edit_status"
class="am-btn am-btn-danger am-btn-xs"
data-params-id="<?= $v['id'] ?>" data-params-status="0">关闭</a>
<?
} ?>
<? if ($v['status'] == 0) { ?>
<a data-ajax="post" data-action="/receiver/ownersTag/edit_status"
class="am-btn am-btn-success am-btn-xs"
data-params-id="<?= $v['id'] ?>" data-params-status="1">开启</a>
<? } ?>
<a data-ajax="post" data-action="/receiver/ownersTag/del"
class="am-btn am-btn-danger am-btn-xs"
data-params-id="<?= $v['id'] ?>">删除</a>
<td colspan="8">
<div class="row">
<div class="col-md-4 align-l">
</div>
<div class="col-md-8 align-r" style="padding-right: 30px;">
<a data-modal="/common/bind_mobile?id=<?= $v['id'] ?>&type=clues"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
data-title="获取手机号">拨打电话</a>
<a data-modal="/common/show_sms?id=<?= $v['id'] ?>&type=clues"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
data-title="发送短信">短信</a>
<a data-open="/receiver/clues/get?id=<?= $v['id'] ?>&type=clues"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs">查看详情</a>
</div>
</td>
</tr>
<?php }
<? }
} ?>
</tbody>
</table>
<div id="options-modal" style="display: none;">
<table class="table table-hover table-middle" style="table-layout:fixed">
<colgroup>
<col width="65%">
<col width="15%">
<col width="">
</colgroup>
<thead>
<tr>
<th class="text-center">标题</th>
<th class="text-center">排序</th>
<th class="text-right">
<a href="javascript:" style="margin-top: 2px;" class="btn btn-primary btn-sm"
@click='addOptions()'>添加</a>
</th>
</tr>
</thead>
<tbody>
<template v-for="(item,index) in optionsList">
<tr v-if="item.status==1">
<td class="text-center">
<input :id="'name_'+index" @blur="editName(index)" class="form-control"
v-model="item.name" placeholder="请输入标题"></td>
<td class="text-center">
<input :id="'group_name_'+index" @blur="editGroupName(index)" class="form-control"
v-model="item.sort" type="number" placeholder="请输入排序值">
</td>
<td class="text-right">
<a href="javascript:void(0);" style="margin-top:2px;"
class="btn btn-danger btn-sm" @click='delOptions(index)'>删除</a>
</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
<? page_view($pager) ?>
</div>
</div>
<div id="cule-modal" style="display: none;padding: 10px">
<div class="modal-body">
<div class="text-center">
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
<div class="form-group-action">
<a href="/temp/clues.xlsx" target="_blank" class="btn btn-default">查看模板</a>
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
<form id="import-form">
<input type="file" id="clue-file" name="file" accept=".xls,.xlsx"
style="left:-9999px;position:absolute;" onchange="load_clue()">
</form>
<span>上传Excel文件</span>
</label>
</div>
</div>
</div>
</div>
</div>
<script>
var vue_obj;
$(function () {
vue_obj = new Vue({
el: '#vue-show',
el: '#search_form',
data: {
optionsList: [],
city_id:<?=$params['city_id'] ? $params['city_id'] : 0?>,
county_id:<?=$params['county_id'] ? $params['county_id'] : 0?>,
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
cityAry: [],
countyAry: []
},
mounted: function () {
this.getCfroms()
this.init_citys();
},
methods: {
optionsModal: function (id, name) {
layer.open({
type: 1,
area: ['50%', '50%'], //宽高
content: $('#options-modal'),
title: '编辑【' + name + '】选项',
shade: false,
btn: ['保存', '取消'],
yes: function (index) {
$.ajax({
url: '/receiver/ownersTag/edit_options',
type: 'post',
dataType: 'json',
data: {id: id, options: that.optionsList},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
}
});
init_citys: function () {
var vm = this;
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
});
var that = this;
$.ajax({
url: '/receiver/ownersTag/get_options',
type: 'post',
dataType: 'json',
data: {id: id},
beforeSend: function () {
},
success: function (re) {
if (re.code) {
that.optionsList = re.data.lists;
} else {
layer.msg(re.msg, {icon: 2});
if (vm.city_id > 0) {
$.get('common/area', {id: vm.city_id, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
vm.countyAry = response.data;
}
},
complete: function () {
}
});
}
},
getCfroms: function () {
var that = this
$.get('/receiver/CluesCfrom/json_get', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
$.get('/receiver/CluesCfrom/json_get', {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
},
addOptions: function () {
reset: function () {
var that = this;
that.optionsList.push({id: 0, name: '', status: 1, qy_id: '', sort: 50});
},
delOptions: function (index) {
var that = this;
if (that.optionsList[index]['id'] > 0) {
that.optionsList[index]['status'] = -1;
} else {
that.optionsList.splice(index, 1);
}
},
editName: function (index) {
var name = $("#name_" + index).val();
if (name == '') {
layer.msg("标题不能为空!", {icon: 2});
return false;
}
},
// 修改排序
editGroupName: function (index) {
var order_view = $("#group_name_" + index).val();
if (order_view == '') {
layer.msg("排序值不能为空!", {icon: 2});
return false;
}
this.optionsList.sort(function (a, b) {
return b.sort - a.sort;
})
},
$('#search_tp').val('mobile');
$('#title').val('');
$('#id-create-time').val('');
$('#id-en-time').val('');
that.city_id = '0';
that.county_id = '0';
that.cfrom_id = 0;
that.cfrom_id2 = 0;
}
},
watch: {}
watch: {
'city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.county_id = '0';
} else {
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
if (response.code == 1) {
that.countyAry = response.data;
if (that.county_id > 0) {
var county_id = '0';
for (var i in that.countyAry) {
var county = that.countyAry[i];
if (county.id == that.county_id) {
county_id = county.id;
break;
}
}
that.county_id = county_id;
}
}
});
}
},
'cfrom_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cfrom_id2 = 0;
that.cfroms2 = [];
} else {
$.get('/receiver/CluesCfrom/json_get', {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
for (var i in that.cfroms) {
var county = that.cfroms[i];
if (county.id == that.cfrom_id2) {
cfrom_id2 = county.id;
break;
}
}
that.cfrom_id2 = cfrom_id2;
}
});
}
}
}
});
$("#import").click(function () {
$("#clue-file").val('');
layer.open({
type: 1,
area: ['40%'], //宽高
content: $('#cule-modal'),
title: '导入线索',
shade: false,
btn: ['完成'],
yes: function (index) {
layer.close(index);
}
});
});
<?php page_script($pager) ?>
});
</script>
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
laydate.render({
elem: '#id-en-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var source_id = $(this).data('source') || 'id-create-time';
var beginDate = '', endDate = '';
switch (type) {
case 'today':
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
break;
case 'yesterday':
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
$('#' + source_id).val(date);
});
});
function edit_adviser() {
var ids = function () {
var data = [];
return $(".order-ids").map(function () {
(this.checked) && data.push(this.value);
}), data.join(',');
}.call(this);
if (ids.length < 1) {
return $.msg.tips('请选择需要操作的数据!');
}
return $.form.modal("/receiver/clues/get_adviser?ids=" + ids, 'open_type=modal', "分配顾问");
}
function load_clue() {
var file = $("#clue-file");
if (file.val() == '') {
layer.msg('文件是空的');
return 0;
}
var loading = layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
var options = {
url: "/receiver/clues/add_excel",
type: "post",
dataType: "json",
data: {},
success: function (res) {
if (1 == res.code) {
layer.msg(res.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
}
},
complete: function () {
file.val('');
layer.close(loading);
}
};
$("#import-form").ajaxSubmit(options);
}
</script>
+3 -3
View File
@@ -100,11 +100,11 @@
methods: {
getCfroms: function () {
var that = this;
$.get('/receiver/clues/get_cfroms', function (result) {
$.get('/receiver/CluesCfrom/json_get', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
$.get('/receiver/clues/get_cfroms', {'id': that.cfrom_id}, function (result) {
$.get('/receiver/CluesCfrom/json_get', {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
@@ -117,7 +117,7 @@
that.cfrom_id2 = 0;
that.cfroms = [];
} else {
$.get('/receiver/clues/get_cfroms', {'id': nv}, function (result) {
$.get('/receiver/CluesCfrom/json_get', {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
+4 -1
View File
@@ -66,12 +66,15 @@
<td>{{item.status_name}}</td>
<td>{{item.c_time}}</td>
<td>
<a :data-open="'/topics/enroll/lists?id='+item.id"
class="am-btn am-btn-primary am-btn-xs">报名列表</a>
<input type="button" class="am-btn am-btn-xs am-btn-danger"
data-ajax="post" data-action="/topics/topics/edit_status"
:data-params-id="item.id" :data-params-status="item.che_status"
:value="item.che_status_name"/>
<a :data-open="'/topics/topics/get?id='+item.id"
class="am-btn am-btn-primary am-btn-xs">编辑</a></td>
class="am-btn am-btn-primary am-btn-xs">编辑</a>
</td>
</tr>
</template>
</tbody>
+205
View File
@@ -0,0 +1,205 @@
<div class="coms-table-wrap mt10" id="vue-app">
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/topics/enroll/lists">
<input name="id" type="hidden" value="<?= $params['id'] ?>"/>
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">昵称:</label>
<div class="am-para-inline w200">
<input type="text" id="id_nickname" name="nickname" value="<?= $params['nickname'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">手机号:</label>
<div class="am-para-inline w200">
<input type="text" id="id_mobile" name="mobile" value="<?= $params['mobile'] ?>" placeholder="手机号"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id2" v-model="cfrom_id2">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms2">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group fl ml10">
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="order-lists-time" type="text" name="time" value="<?= $params['time'] ?>"
placeholder="报名日期范围"/>
</div>
</div>
<div class="am-form-group fl mb10" style="margin-top: 5px">
<div class="am-para-inline w300">
<a class="mr10 order-lists-time-btn" href="javascript:void (0);" data-date="today">今天</a>
<a class="mr10 order-lists-time-btn" href="javascript:void (0);"
data-date="yesterday">昨日</a>
<a class="mr10 order-lists-time-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
<a class="mr10 order-lists-time-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
</div>
</div>
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" @click="export_out" class="am-btn am-btn-success am-btn-sm w100">导出</button>
</div>
</div>
</form>
<div class="coms-table-bd" style="margin-top: 15px;">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="5%"><span>ID</span></th>
<th width="15%"><span>昵称</span></th>
<th width="15%"><span>手机号</span></th>
<th width="15%"><span>报名时间</span></th>
<th width="20%"><span>来源</span></th>
</tr>
</thead>
<tbody>
<template v-for="(item,index) in list">
<tr>
<td>{{item.id}}</td>
<td>{{item.nickname}}</td>
<td>{{item.mobile}}</td>
<td>{{item.c_time}}</td>
<td>{{item.cf_name}}</td>
</tr>
</template>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
//日期范围
laydate.render({
elem: '#order-lists-time'
, range: '~'
});
$('.order-lists-time-btn').click(function () {
var type = $(this).data('date'), date = '', d_obj = new Date();
switch (type) {
case 'today':
date = d_obj.Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case 'yesterday':
date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd');
date = date + ' ~ ' + date;
break;
case '7day':
date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
case '30day':
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
break;
}
$('#order-lists-time').val(date);
});
});
var layer_open;
var vue_obj;
var loading = false;
$(document).ready(function () {
vue_obj = new Vue({
el: '#vue-app',
data: {
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
list: []
},
mounted: function () {
var that = this;
that.list = <?=json_encode($lists)?>;
this.getCfroms();
},
computed: {},
created: function () {
},
updated: function () {
},
methods: {
reset: function () {
var that = this;
$('#id_nickname').val('');
$('#id_mobile').val('');
$('#order-lists-time').val('');
that.cfrom_id = 0;
that.cfrom_id2 = 0;
},
export_out: function () {
var count = <?=$pager['totle']?>;
if (count > 10000) {
layer.msg('单次导出数据不能超过10000');
return false;
}
var href = $.menu.parseUri(window.location.href);
href = href.replace("lists", "export");
window.location.href = href;
},
getCfroms: function () {
var that = this
$.get('/receiver/CluesCfrom/json_get', function (result) {
that.cfroms = result.data.data
});
if (that.cfrom_id > 0) {
$.get('/receiver/CluesCfrom/json_get', {'id': that.cfrom_id}, function (result) {
that.cfroms2 = result.data.data
});
}
}
},
watch: {
'cfrom_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.cfrom_id2 = 0;
that.cfroms2 = [];
} else {
$.get('/receiver/CluesCfrom/json_get', {'id': nv}, function (result) {
that.cfroms2 = result.data.data;
if (that.cfrom_id2 > 0) {
var cfrom_id2 = '0';
for (var i in that.cfroms) {
var county = that.cfroms[i];
if (county.id == that.cfrom_id2) {
cfrom_id2 = county.id;
break;
}
}
that.cfrom_id2 = cfrom_id2;
}
});
}
}
}
});
});
</script>
+23 -7
View File
@@ -13,7 +13,6 @@ require_once APPPATH . 'controllers/wxapp/Wxapp.php';
*/
class Topics extends Wxapp
{
private $cf_id = 7;//自主报名
function __construct($inputs, $app_key)
{
@@ -27,6 +26,7 @@ class Topics extends Wxapp
$this->load->model('topics/topic_module_text_model', 'mdModuleText');
$this->load->model('topics/topic_module_ad_model', 'mdModuleAd');
$this->load->model('topics/topic_module_button_model', 'mdModuleButton');
$this->load->model('topics/topic_enroll_model', 'mdEnroll');
$this->load->model('receiver/receiver_clues_model', 'mdReceiverClues');
}
@@ -160,22 +160,38 @@ class Topics extends Wxapp
*/
protected function post()
{
$id = $this->input_param('id');
$topics_id = $this->input_param('id');
$mobile = $this->session['mobile'];
$nickname = $this->session['nickname'];
if (!$id || !$mobile) {
if (!$topics_id || !$mobile) {
throw new Hd_exception('参数错误', API_CODE_INVILD_PARAM);
}
$cf_id = 0;
$re = $this->mdTopics->get(['id' => $topics_id]);
$re['cf_id'] && $cf_id = $re['cf_id'];
//报名表
$re_enroll = $this->mdEnroll->get(['mobile' => $mobile, 'topics_id' => $topics_id]);
if (!$re_enroll) {
$add_data = [
'nickname' => $nickname ? $nickname : '',
'mobile' => $mobile,
'topics_id' => $topics_id,
'cf_id' => $cf_id,
'c_time' => time()
];
$this->mdEnroll->add($add_data);
}
//线索表
$this->load->library('receiver/clues_entity');
$cf_title = $this->clues_entity->cf_title($this->cf_id);
$cf_title = $this->clues_entity->cf_title($cf_id);
$log_msg = '用户报名';
$cf_title && $log_msg = "用户通过【{$cf_title}】报名";
$uname = $nickname ? $nickname : '用户';
$row = $this->mdReceiverClues->get(['mobile' => $mobile]);
if ($row) {
$update = ['en_time' => date('Y-m-d H:i:s')];
$this->mdReceiverClues->update($update, ['id' => $row['id']]);
//增加日志
$uname = $nickname ? $nickname : '用户';
$this->clues_entity->add_log($row['id'], $this->session['uid'], $uname, $log_msg);
throw new Hd_exception('预约报名成功了!', API_CODE_SUCCESS);
}
@@ -183,9 +199,9 @@ class Topics extends Wxapp
'name' => $nickname ? $nickname : '',
'mobile' => $mobile,
'cf_uid' => $this->session['uid'],
'cf_id' => $this->cf_id,
'cf_id' => $cf_id,
'app_id' => $this->app_id,
'out_id' => $id,
'out_id' => $topics_id,
'if_driver' => 1,
'cf_platform' => 'wxapp',
'en_time' => date('Y-m-d H:i:s'),
@@ -0,0 +1,17 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Notes:专题-报名数据表
* Created on: 2023/3/27 13:46
* Created by: dengbw
*/
class Topic_enroll_model extends HD_Model
{
private $table_name = 'lc_topic_enroll';
public function __construct()
{
parent::__construct($this->table_name, 'default');
}
}
+2 -2
View File
@@ -268,7 +268,7 @@ class Live extends BaseController
$list = [];
if ($count) {
$offset = ($page - 1) * $limit;
$res = $this->db->select('a.*,b.createdTime as time')
$res = $this->db->select('a.*,b.createdTime as time,b.param2 as uname')
->from('lc_market_sylive_viewlog as a')
->join('lc_live_polyv_viewlog as b', "b.id=a.vlogId", 'left')
->where($where)
@@ -278,7 +278,7 @@ class Live extends BaseController
$user_ids = implode(",", array_column($res, 'userId'));
$map_user = $this->mdSyliveUser->map('userId', 'uname', ["userId in({$user_ids})" => null]);
foreach ($res as $v) {
$uname = '';
$uname = $v['uname'];
$consultant = $this->consultantGet(['userId' => $v['userId']
, 'levelId1' => $v['levelId1'], 'levelId2' => $v['levelId2'], 'levelId3' => $v['levelId3']
, 'bizId' => $v['bizId'], 'cfUserId' => $v['cfUserId']]);