Template_1025_2

This commit is contained in:
dengbw
2021-10-25 17:48:41 +08:00
parent da3d276408
commit 127106d927
5 changed files with 102 additions and 4 deletions
+9
View File
@@ -16,6 +16,7 @@ class Main extends HD_Controller
parent::__construct();
$this->load->model('app/licheb/App_licheb_users_model', 'userM');
$this->load->model('app/material/Material_template_model', 'mdTemplate');
$this->load->model('app/material/Material_biz_model', 'mdMaterialBiz');
}
public function index()
@@ -42,6 +43,14 @@ class Main extends HD_Controller
array('name' => '查看详情', 'url' => '/app/material/template/index?app_id=' . $this->app_id),
),
);
$value = $this->mdMaterialBiz->count(array('app_id' => $this->app_id), 'distinct(biz_id)');
$list[] = array(
'title' => '素材门店统计(家)',
'value' => $value,
'btns' => array(
array('name' => '查看详情', 'url' => '/app/material/template/lists_biz?app_id=' . $this->app_id),
),
);
$conditions[] = array('icon' => 'am-icon-home', 'list' => $list);
/*小程序设置 end*/
+38 -1
View File
@@ -75,6 +75,43 @@ class Template extends HD_Controller
}
public function lists_biz()
{
$params = $this->input->get();
$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']);
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,'distinct(biz_id)');
if ($count) {
$fileds = "distinct(biz_id)";
$res = $this->mdMaterialBiz->select($where, "biz_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));
$count_c = $this->mdCustomers->count(array('biz_id' => $biz_id, 'cf_id' => $this->cf_id, 'status >=' => 0));
$count_o = $this->mdBizStatistics->count_order(array('c.biz_id' => $biz_id, 'c.cf_id' => $this->cf_id, 'c.status >=' => 0));
$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']];
$lists[] = $setValue;
}
}
$this->data['lists'] = $lists;
$this->data['params'] = $params;
$this->data['_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 lists_t_biz()
{
$params = $this->input->get();
$t_id = intval($params['t_id']);
@@ -114,7 +151,7 @@ class Template extends HD_Controller
$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);
return $this->show_view('/app/material/template/lists_t_biz', true);
}
//展示单条数据
+1 -1
View File
@@ -72,7 +72,7 @@
<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'] ?>"
<a data-open="/app/material/template/lists_t_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"
@@ -20,22 +20,22 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="3%"><span>id</span></th>
<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_id'] ?></td>
<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>
@@ -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_t_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>