导入增加自定义标签,导出筛选

master
zcstatham 2 years ago
parent 4dbd9203cc
commit effff618e4
  1. 7
      app/controller/Index.php
  2. 5
      app/controller/Task.php
  3. 9
      app/view/index/index.html
  4. 6
      app/view/task/index.html
  5. 4
      extend/service/CarInfoHandle.php
  6. BIN
      public/static/tpl.xlsx

@ -337,6 +337,13 @@ class Index extends BaseController
});
$map[] = ['car_info_t.car_man', 'like', $car_man];
}
if (isset($params['tag']) && $params['tag'] != '') {
$tags = explode(',', str_replace(',', '', $params['car_man']));
array_walk($tags, function (&$value) {
$value = '%' . $value . '%';
});
$map[] = ['car_info_t.car_man', 'like', $tags];
}
if (isset($params['factory_model']) && $params['factory_model'] != '') {
$factory_model = explode(',', str_replace(',', '', $params['factory_model']));
array_walk($factory_model, function (&$value) {

@ -160,6 +160,9 @@ class Task extends BaseController
if (isset($params['price2']) && $params['price2'] != '') {
$where[] = ['car_info_t.purchase_price', '<=', $params['price2'] * 10000];
}
if (isset($params['tag']) && $params['tag'] != '') {
$where[] = ['car_info_t.tag', '=', $params['tag']];
}
if(isset($params['empty_phone_check']) && $params['empty_phone_check'] == 'yes'){
$where[] = ['car_phone', '<>', ''];
}
@ -621,7 +624,7 @@ class Task extends BaseController
$highestColumn = $sheet->getHighestColumn(); // e.g 'F'
$title = $sheet->rangeToArray("A1:{$highestColumn}1")[0];
$tpl_title = ['税号', '初登日期', '车主', '证件号', '电话号码', '车架号', '车牌号', '发动机号', '车型', '新车购置价'];
$tpl_title = ['税号', '初登日期', '车主', '证件号', '电话号码', '车架号', '车牌号', '发动机号', '车型', '新车购置价', '自定义标签'];
// $tpl_title = ['区域', '购车日期', '客户姓名', '证件号码', '联系方式', '车架号', '车牌号', '发动机号', '品牌型号', '新车购置价', '保险公司', '商业止保日期', '交强止保日期', '被保险人', '被保险人证件号'];
if (count(array_diff($tpl_title, $title)) > 0) {
return false;

@ -156,7 +156,14 @@
<input type="text" name="price2" class="layui-input" placeholder="万">
</div>
</div>
<div class="layui-form-item layui-col-md12" style="clear: none;">
<div class="layui-form-item layui-col-md2" style="clear: none;">
<label class="layui-form-label">标签</label>
<div class="layui-input-block">
<input type="text" name="tag" id="tag" autocomplete="off"
class="layui-input" value="{$params.tag | default=''}">
</div>
</div>
<div class="layui-form-item layui-col-md10" style="clear: none;">
<label class="layui-form-label">数据状态</label>
<div class="layui-input-block" style="height: auto;">
<table class="layui-table">

@ -52,6 +52,12 @@
<input type="text" name="insurer_day2" class="layui-input" style="display: inline-block; width: 60px;">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width: 140px;">标签</label>
<div class="layui-input-inline" style="width: 200px;">
<input type="text" name="tag" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">

@ -51,6 +51,9 @@ class CarInfoHandle
if (isset($data['price2']) && $data['price2'] != '') {
$where[] = ['car_info_t.purchase_price', '<=', $data['price2'] * 10000];
}
if (isset($params['tag']) && $params['tag'] != '') {
$where[] = ['car_info_t.tag', '=', $params['tag']];
}
if (isset($data['empty_phone_check']) && $data['empty_phone_check'] == 'yes') {
$where[] = ['car_phone', '<>', ''];
}
@ -569,6 +572,7 @@ class CarInfoHandle
'engine_no' => trim(trim($worksheet->getCellByColumnAndRow(8, $row)->getValue(), '"')),
'factory_model' => trim(trim($worksheet->getCellByColumnAndRow(9, $row)->getValue(), '"')),
'purchase_price' => trim(trim($worksheet->getCellByColumnAndRow(10, $row)->getValue(), '"')),
'tag' => trim(trim($worksheet->getCellByColumnAndRow(11, $row)->getValue(), '"')),
'source' => $id,
'create_timestamp' => $now,
'update_timestamp' => $now

Binary file not shown.
Loading…
Cancel
Save