admin_material_1019

This commit is contained in:
dengbw
2021-10-19 13:52:33 +08:00
parent 03cc6536c1
commit b933d64af1
6 changed files with 134 additions and 15 deletions
+1 -8
View File
@@ -942,14 +942,7 @@ class Common extends CI_Controller
$this->load->library('hdwechat', $wxconfig);
$result = $this->hdwechat->qrcode($filename, $scene, $page, $width);
if ($result) {
if (false !== strpos($_SERVER['HTTP_HOST'], 'dev')) { //dev 测试
$base_url = 'https://hd-api-dev.xiaoyu.com/';
} elseif (false !== strpos($_SERVER['HTTP_HOST'], 'test')) {//test 测试
$base_url = 'https://api.test.haodian.cn/';
} else { // 正式
$base_url = 'https://api.haodian.cn/';
}
$this->data['qrcode'] = $base_url . $result['url'];
$this->data['qrcode'] = http_host_com() .'/'. $result['url'];
}
// $scene = 82;
// $url_params = array('path' => '/' . $page, 'query' => 'id=' . $scene . '&form=auth&_um_campaign=604823e96ee47d382b7a2b79&_um_channel=604823e96ee47d382b7a2b7a',
@@ -9,11 +9,17 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
class Template extends HD_Controller
{
private $cf_id = 24;//素材报名
public function __construct()
{
parent::__construct();
$this->load->model('app/material/Material_template_model', 'mdTemplate');
$this->load->model('app/material/Material_biz_model', 'mdMaterialBiz');
$this->load->model('app/material/Material_biz_statistics_model', 'mdBizStatistics');
$this->load->model('receiver/receiver_customers_model', 'mdCustomers');
$this->load->model('auto/auto_brand_model', 'mdAutoBrand');
$this->load->model("biz/biz_model", 'mdBiz');
}
//首页信息
@@ -68,6 +74,49 @@ class Template extends HD_Controller
return $this->show_view('/app/material/template/lists', true);
}
public function lists_biz()
{
$params = $this->input->get();
$t_id = intval($params['t_id']);
if (!$t_id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$re = $this->mdTemplate->get(array('id' => $t_id));
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = $users = array();
$where = array('app_id' => $params['app_id'], 't_id' => $t_id);
if ($params['biz_name']) {
$where['biz_id in (select id from lc_biz where biz_name like "%' . $params['biz_name'] . '%")'] = null;
}
$count = $this->mdMaterialBiz->count($where);
if ($count) {
$fileds = "biz_id,c_time";
$res = $this->mdMaterialBiz->select($where, "id desc", $params['page'], $params['size'], $fileds);
$str_ids = implode(',', array_unique(array_column($res, 'biz_id')));
$map_biz = $this->mdBiz->map('id', 'biz_name', array("id in({$str_ids})" => null));
foreach ($res as $key => $value) {
$setValue = array();
$biz_id = intval($value['biz_id']);
$re_s = $this->mdBizStatistics->sum('browse_num', array('app_id' => $params['app_id'], 'biz_id' => $biz_id, 't_id' => $t_id));
$count_c = $this->mdCustomers->count(array('biz_id' => $biz_id, 'cf_id' => $this->cf_id, 'status >=' => 0, 't_id' => $t_id));
$count_o = $this->mdBizStatistics->count_order(array('c.biz_id' => $biz_id, 'c.cf_id' => $this->cf_id, 'c.status >=' => 0, 'c.t_id' => $t_id));
$setValue['browse_num'] = intval($re_s['browse_num']);
$setValue['baoming_num'] = $count_c;
$setValue['order_name'] = $count_o;
$setValue['biz_id'] = $biz_id;
$setValue['biz_name'] = $map_biz[$value['biz_id']];
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_title'] = $re['title'] . '_门店使用数据列表';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
return $this->show_view('/app/material/template/lists_biz', true);
}
//展示单条数据
public function get()
{
+16 -3
View File
@@ -54,7 +54,6 @@
<th width="25%"><span>适用品牌</span></th>
<th width="7%"><span>状态</span></th>
<th width="10%"><span>创建时间</span></th>
<th width="6%"><span>操作</span></th>
</tr>
</thead>
<tbody>
@@ -66,8 +65,22 @@
<td><?= $v['brands'] ?></td>
<td><?= $v['status_name'] ?></td>
<td><?= $v['c_time'] ?></td>
<td><a data-open="/app/material/template/get?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">修改</a></td>
</tr>
<tr>
<td colspan="6">
<div class="row">
<div class="col-md-4 align-l">
</div>
<div class="col-md-8 align-r" style="padding-right: 30px;">
<a data-open="/app/material/template/lists_biz?t_id=<?= $v['id'] ?>&app_id=<?= $params['app_id'] ?>"
class="am-btn am-btn-primary am-btn-xs">门店数据</a>
<a class="am-btn am-btn-primary am-btn-xs"
data-modal="/common/share_link?id=<?= $v['id'] ?>&app_id=1&pages=special2"
data-title="分享连接">分享链接</a>
<a data-open="/app/material/template/get?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">查看详情</a>
</div>
</td>
</tr>
<?php } ?>
</tbody>
@@ -0,0 +1,52 @@
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/app/material/template/lists_biz">
<input type="hidden" name="app_id" value="<?= $params['app_id'] ?>">
<input type="hidden" name="t_id" value="<?= $params['t_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 w260">
<input type="text" name="biz_name" value="<?= $params['biz_name'] ?>"/>
</div>
</div>
<div class="am-form-group fl ml30">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
</div>
</form>
<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="15%"><span>浏览次数</span></th>
<th width="15%"><span>报名客户</span></th>
<th width="15%"><span>订单客户</span></th>
<th width="15%"><span>创建时间</span></th>
<th width="10%"><span>操作</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['browse_num'] ?></td>
<td><?= $v['baoming_num'] ?></td>
<td><?= $v['order_name'] ?></td>
<td><?= $v['c_time'] ?></td>
<td><a class="am-btn am-btn-primary am-btn-xs"
data-modal="/common/share_link?id=<?= $v['biz_id'] ?>&app_id=1&pages=storeInfo"
data-title="狸车小程序店铺首页">分享链接</a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
</div>
+3
View File
@@ -142,6 +142,9 @@
</tr>
<tr>
<td colspan="5" class="align-r">
<a class="am-btn am-btn-primary am-btn-xs"
data-modal="/common/share_link?id=<?= $v['id'] ?>&app_id=1&pages=storeInfo"
data-title="狸车小程序店铺首页">分享链接</a>
<a data-open="/biz/store/store/get?id=<?= $v['id'] ?>" class="am-btn am-btn-primary am-btn-xs">修改</a>
<input type="hidden" class="biz-id-<?= $v['id'] ?>" name="id" value="<?= $v['id'] ?>" checked>
<select data-update-group="" data-list-target=".biz-id-<?= $v['id'] ?>"
+13 -4
View File
@@ -26,7 +26,7 @@ class App_model extends HD_Model
public function appConfig($app_id = null)
{
$map_config = array(
'1' => array(
1 => array(
'app_key' => 'liche',
'table' => 'hd_app_liche_users',
'model' => 'app/liche/app_liche_users_model',
@@ -34,14 +34,23 @@ class App_model extends HD_Model
'appid' => 'wx98e64c11aac45966',
'secret' => 'f8eec7be1c87a1c8e40213e144821ec3',
'pages_groupcode_detail' => 'pages/groupCode/index',
'pages_special2' => 'pages/special2/index',
'pages_storeInfo' => array('id' => 'biz_id', 'pages' => 'pages/storeInfo/index'),
),
),
2 => array(
'app_key' => 'licheb',
'table' => 'hd_app_licheb_users',
'model' => 'app/licheb/app_licheb_users_model',
'wx' => array(
'appid' => 'wx71095d4049de3ed1',
'secret' => 'a80eb6ed68d7bae2d804fe507a4522f7',
),
),
);
if(is_null($app_id)){
if (is_null($app_id)) {
return $map_config;
}
return $map_config[$app_id];
}
}