门店4s列表显示品牌数据 && 修复错误日志报错

This commit is contained in:
lcc
2025-10-12 09:52:38 +08:00
parent f71509e7b6
commit 36fed7a26d
4 changed files with 29 additions and 6 deletions
+18 -3
View File
@@ -69,6 +69,12 @@ class Store extends HD_Controller
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
$params['type'] && $where['type'] = $params['type'];
if ($params['brand_id']) {
$brand_biz_list = $this->biz_car_brand_model->select(['brand_id' => intval($params['brand_id'])], '', 0, 0, 'biz_id');
$bizIds = array_column($brand_biz_list, 'biz_id');
$bizIdString = $bizIds ? implode(',', $bizIds) : 0;
$where["id in ({$bizIdString})"] = null;
}
$typeAry = $this->biz_model->type_ary();
$biz_lists = $this->biz_model->select($where, 'id desc', $page, $pagesize);
$count = $this->biz_model->count($where);
@@ -85,7 +91,16 @@ class Store extends HD_Controller
$v['money_left'] = $bizAccount ? $bizAccount['money_left'] : 0;
$v['c_time'] = date('Y-m-d H:i:s', $v['c_time']);
$v['biz_type'] = $typeAry[$v['type']];
$v['brand_name'] = $map[$v['car_brand_id']];
// $v['brand_name'] = $map[$v['car_brand_id']];
$brand_name_list = [];
//获取门店品牌
$bizBrand = $this->biz_car_brand_model->map('brand_id', '', ['biz_id' => $v['id']], '', '', '', 'brand_id,biz_id');
if ($bizBrand) {
foreach ($bizBrand as $k1 => $v1) {
$brand_name_list[] = $map[$k1];
}
}
$v['brand_name'] = $brand_name_list ? implode(',', $brand_name_list) : '';
$bizlists[] = $v;
}
}
@@ -235,8 +250,8 @@ class Store extends HD_Controller
return $this->show_json(SYS_CODE_FAIL, '添加失败');
}
if (is_array($car_brand_ids)) {
$brandIds = implode(',',$car_brand_ids);
$brandIds && $this->biz_car_brand_model->delete(['biz_id' => $id,'brand_id NOT IN('.$brandIds.')'=>null]);
$brandIds = implode(',', $car_brand_ids);
$brandIds && $this->biz_car_brand_model->delete(['biz_id' => $id, 'brand_id NOT IN(' . $brandIds . ')' => null]);
$carBrandData = [];
foreach ($car_brand_ids as $item) {
$carBrandData[] = [
+3
View File
@@ -18,7 +18,10 @@ class Login extends BaseController
$this->load->model('agent/admin/Market_sys_menu_model', 'mdSysMenu');
$this->load->model('agent/admin/Market_sys_login_record_model', 'mdSysLoginRecord');
}
public function index_get()
{
}
/**
* Notes:用户登录
* Created on: 2022/9/8 14:49
+5
View File
@@ -10,6 +10,11 @@ class Login extends BaseController
parent::__construct();
}
public function index_get()
{
}
public function index_post()
{
$path = 'login';
@@ -26,9 +26,9 @@ class Auto_product_label_model extends HD_Model
$labelIdString = implode(',', $labelIdArray);
$productIds = [];
if ($labelIdString) {
$priceRangeIds = implode(',', $priceRange);
$carProductLabelIds = implode(',', $carProductLabel);
$productLevelIds = implode(',', $productLevel);
$priceRangeIds = $priceRange ? implode(',', $priceRange) : '';
$carProductLabelIds = $carProductLabel ? implode(',', $carProductLabel) : '';
$productLevelIds = $productLevel ? implode(',', $productLevel) : '';
$subSql = "SELECT product_id FROM lc_auto_product_label WHERE label_id IN ({$labelIdString}) GROUP BY product_id";
$havingWhere = [];
$priceRangeIds && $havingWhere[] = "SUM(CASE WHEN label_id IN ({$priceRangeIds}) THEN 1 ELSE 0 END)>=1";