user_10113

This commit is contained in:
dengbw
2022-10-13 11:24:03 +08:00
committed by lccsw
parent b0e5dffd5b
commit 49d3e59b59
3 changed files with 59 additions and 9 deletions
+22 -1
View File
@@ -52,6 +52,7 @@ class Template extends HD_Controller
$setValue['title'] = $value['title'];
$setValue['type_name'] = $this->mdTemplate->typeAry()[$value['type']];
$setValue['status_name'] = $this->mdTemplate->statusAry()[$value['status']];
$setValue['status'] = $value['status'];
$brands = '';
if ($value['brand_ids']) {
$res_b = $this->mdAutoBrand->select(array("id in ({$value['brand_ids']})" => null, 'status' => 1), "id desc", 0, 0, 'name');
@@ -391,7 +392,27 @@ class Template extends HD_Controller
//批量操作(默认修改状态)
public function batch()
{
$field = $this->input->post('field');
if ($field === 'ifcheck') {
$status = intval($this->input->post('value'));
$ids = $this->input->post('id');
$ids = explode(',', $ids);
if (!$ids || count($ids) < 1) {
$this->show_json(0, '请选择要操作的选项');
}
$ids_str = implode(',', $ids);
$where = ["id in({$ids_str})" => null];
} else {
$id = intval($this->input->post('id'));
$status = intval($this->input->post('value'));
if (!$id) {
$this->show_json(0, '参数错误');
}
$where['id'] = $id;
}
$data['status'] = $status;
$this->mdTemplate->update($data, $where);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
//导出数据列表
+29 -5
View File
@@ -48,17 +48,21 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="3%"><span>id</span></th>
<th width="15%"><span>模板名称</span></th>
<th width="10%"><span>模板分类</span></th>
<th width="25%"><span>适用品牌</span></th>
<th width="50"></th>
<th width="50"><span>id</span></th>
<th width="17%"><span>模板名称</span></th>
<th width="13%"><span>模板分类</span></th>
<th width=""><span>适用品牌</span></th>
<th width="7%"><span>状态</span></th>
<th width="10%"><span>创建时间</span></th>
<th width="12%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($lists as $v) { ?>
<tr>
<td rowspan="2">
<input type="checkbox" name="ids[]" class="biz-ids" value="<?= $v['id'] ?>"/>
</td>
<td><?= $v['id'] ?></td>
<td><?= $v['title'] ?></td>
<td><?= $v['type_name'] ?></td>
@@ -79,6 +83,13 @@
data-title="分享连接">分享链接</a>
<a data-open="/app/material/template/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'] ?>"
data-action="/app/material/template/batch" data-field="" style="height: 30px;width: 70px;">
<option value="0" <?= 0 == $v['status'] ? 'selected' : '' ?>>下架</option>
<option value="1" <?= 1 == $v['status'] ? 'selected' : '' ?>>上架</option>
<option value="-1" <?= -1 == $v['status'] ? 'selected' : '' ?>>删除</option>
</select>
</div>
</td>
</tr>
@@ -87,6 +98,19 @@
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
<label class="checkall">
<input type="checkbox" data-check-target=".biz-ids"> 全选</label>
<div class="am-para-inline w120">
<select data-update-group="" data-list-target=".biz-ids" data-action="/app/material/template/batch"
data-field="ifcheck">
<option value="">批量操作</option>
<option value="0">下架</option>
<option value="1">上架</option>
<option value="-1">删除</option>
</select>
</div>
</div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
+8 -3
View File
@@ -341,6 +341,9 @@ class User extends Wxapp
//战败
$where_today_defeat = ['type' => 7, 'c_time>=' => strtotime($s_today), 'c_time<=' => strtotime($e_today)];
$where_month_defeat = ['type' => 7, 'c_time>=' => strtotime($s_month), 'c_time<=' => strtotime($e_month)];
//退订
$where_today_refund = ['biz_id' => $biz_id, 'status' => 2, 'refund_time>=' => $s_today, 'refund_time<=' => $e_today];
$where_month_refund = ['biz_id' => $biz_id, 'status' => 2, 'refund_time>=' => $s_month, 'refund_time<=' => $e_month];
$where_customer_id = "customer_id in(select id from lc_receiver_customers where biz_id={$biz_id} and cs_biz_id!=-1)";
if ($group_id == 1) {
$where_today_xs['admin_id'] = $uid;
@@ -351,6 +354,8 @@ class User extends Wxapp
$where_month_order['sale_id'] = $uid;
$where_today_defeat['uid'] = $uid;
$where_month_defeat['uid'] = $uid;
$where_today_refund['sale_id'] = $uid;
$where_month_refund['sale_id'] = $uid;
$where_customer_id = "customer_id in(select id from lc_receiver_customers where admin_id={$uid} and biz_id={$biz_id} and cs_biz_id!=-1)";
if ($this->session['userid']) {
$where_today_qy['userid'] = $this->session['userid'];
@@ -383,8 +388,6 @@ class User extends Wxapp
}
$where_today_dd[$where_customer_id] = null;
$where_month_dd[$where_customer_id] = null;
$where_today_order[$where_customer_id] = null;
$where_month_order[$where_customer_id] = null;
$where_today_defeat[$where_customer_id] = null;
$where_month_defeat[$where_customer_id] = null;
$statistics = [
@@ -396,7 +399,9 @@ class User extends Wxapp
['today' => ['title' => '今日', 'value' => $this->receiver_orders_v2_model->count($where_today_order)]
, 'month' => ['title' => '本月订单', 'value' => $this->receiver_orders_v2_model->count($where_month_order)]],
['today' => ['title' => '今日', 'value' => $this->mdCustomerOpLogs->count($where_today_defeat)]
, 'month' => ['title' => '本月战败', 'value' => $this->mdCustomerOpLogs->count($where_month_defeat)]]
, 'month' => ['title' => '本月战败', 'value' => $this->mdCustomerOpLogs->count($where_month_defeat)]],
['today' => ['title' => '今日', 'value' => $this->receiver_orders_v2_model->count($where_today_refund)]
, 'month' => ['title' => '本月退订', 'value' => $this->receiver_orders_v2_model->count($where_month_refund)]]
];
$data = [
'wl_count' => ['title' => '待跟进客户(人)', 'num' => $wl_num, 'url' => '/pages/customer/filterList/index?status=1&visit=1&title=待跟进客户'],