biz_type filter in select about

This commit is contained in:
qianhy
2023-03-10 17:20:07 +08:00
committed by lccsw
parent 41c245843d
commit 3d9203e4de
9 changed files with 43 additions and 10 deletions
+3
View File
@@ -492,6 +492,9 @@ class Common extends CI_Controller
$county_id && $where['county_id'] = $county_id;
$type && $where['type'] = $type;
$ids && $where['id not in (' . $ids . ')'] = null;
$typeAry = $this->mdBiz->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$type_ids && $where["type in ($type_ids)"] = null;
$count = $this->mdBiz->count($where);
if ($count) {
$resBiz = $this->mdBiz->select($where, 'id desc', $page, $size);
+5 -3
View File
@@ -106,7 +106,9 @@ class Member extends HD_Controller
if ($res_biz) {
$biz_id_arr = array_unique(array_column($res_biz, 'biz_id'));
$ids = implode(',', $biz_id_arr);
$selectedBrands = $this->biz_model->select(["id in ($ids)" => null, 'status' => 1], '', 0, 0, 'id as biz_id,biz_name as name');
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$selectedBrands = $this->biz_model->select(["id in ($ids)" => null, "type in ($type_ids)" => null, 'status' => 1], '', 0, 0, 'id as biz_id,biz_name as name');
}
} else if ($row['biz_id']) {
$re_biz = $this->biz_model->get(["id" => $row['biz_id'], 'status' => 1], 'id ,biz_name');
@@ -150,7 +152,7 @@ class Member extends HD_Controller
return $this->show_json(SYS_CODE_FAIL, '请输入姓名');
}
$exist = $this->userM->get(array('mobile' => $mobile));
$exist = $this->userM->get(array('mobile' => $mobile, 'status in (0, 1)' => null));
if ($exist) {
return $this->show_json(SYS_CODE_FAIL, '手机号的用户存在');
}
@@ -188,7 +190,7 @@ class Member extends HD_Controller
return $this->show_json(SYS_CODE_FAIL, '输入正确手机号');
}
$exist = $this->userM->get(array('mobile' => $mobile, 'id <>' => $id));
$exist = $this->userM->get(array('mobile' => $mobile, 'status in (0, 1)' => null, 'id <>' => $id));
if ($exist) {
return $this->show_json(SYS_CODE_FAIL, '手机号的用户存在');
}
+8 -2
View File
@@ -104,10 +104,13 @@ class Store extends HD_Controller
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$type_ids && $where["type in ($type_ids)"] = null;
$biz_lists = $this->biz_model->select($where, 'id desc', $page, $pagesize);
$count = $this->biz_model->count($where);
$bizlists = [];
$typeAry = $this->biz_model->type_ary();
foreach ($biz_lists as $v) {
# 230220close
/*$brand = $this->bizBrand->get(array('id' => $v['brand_id']), 'brand_name');
@@ -957,6 +960,9 @@ class Store extends HD_Controller
$type = $this->input->post('type');
$where = array();
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$type_ids && $where["type in ($type_ids)"] = null;
if (strlen($status) > 0) {
$where['status'] = $status;
} else {
@@ -967,7 +973,7 @@ class Store extends HD_Controller
} else {
if ($_SESSION['admin_info']['biz_id']) {
$biz_ids = implode(',', $_SESSION['admin_info']['biz_id']);
$where["id in ($biz_ids)"] = null;
$where["id in ({$biz_ids})"] = null;
}
}
$province_id && $where['province_id'] = $province_id;
+6 -1
View File
@@ -244,7 +244,9 @@ class Clues extends HD_Controller
if ($re['lat'] && $re['lng']) {
$info_show['near_bizs'] = $this->biz_model->nearby($re['lat'], $re['lng'], 1, 3, 'id,biz_name');
} else {
$info_show['near_bizs'] = $this->biz_model->select(['city_id' => $re['city_id'], 'county_id' => $re['county_id'], 'status' => 1], 'id desc', 1, 3, 'id,biz_name');
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$info_show['near_bizs'] = $this->biz_model->select(['city_id' => $re['city_id'], 'county_id' => $re['county_id'], "type in ($type_ids)" => null, 'status' => 1], 'id desc', 1, 3, 'id,biz_name');
}
//获取分销用户
$cf_user = '';
@@ -568,6 +570,9 @@ class Clues extends HD_Controller
];
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$type_ids && $where["type in ($type_ids)"] = null;
$bizList = $this->biz_model->select($where, '', '', '', 'id,biz_name');
$this->data['bizList'] = $bizList;
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
+3
View File
@@ -43,6 +43,9 @@ class City extends Wxapp
$biz_ids = implode(',', $biz_id_arr);
$biz_where["id in ({$biz_ids})"] = null;
}
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$type_ids && $biz_where["type in ($type_ids)"] = null;
$biz_rows = $this->biz_model->select_groupby('city_id', $biz_where, '', '', '', 'id,city_id');
$city_ids = implode(',', array_column($biz_rows, 'city_id'));
$city_ids && $where["city_id in ($city_ids)"] = null;
+6 -2
View File
@@ -44,7 +44,9 @@ class Statistics extends Wxapp{
$city_id && $o_where = ['city_id'=>$city_id];
$bizs_lists = $this->biz_model->get_by_id_arr($biz_id_arr,$o_where,$fileds);
}else{
$bizs_lists = $this->biz_model->select(['status'=>1,'city_id'=>$city_id],'id desc','','',$fileds);
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$bizs_lists = $this->biz_model->select(['status'=>1,'city_id'=>$city_id,"type in ($type_ids)" => null],'id desc','','',$fileds);
}
if($bizs_lists){
$bizs = array_column($bizs_lists,'biz_name');
@@ -124,7 +126,9 @@ class Statistics extends Wxapp{
$city_id && $o_where = ['city_id'=>$city_id];
$bizs_lists = $this->biz_model->get_by_id_arr($biz_id_arr,$o_where,$fileds);
}else{
$bizs_lists = $this->biz_model->select(['status'=>1,'city_id'=>$city_id],'id desc','','',$fileds);
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$bizs_lists = $this->biz_model->select(['status'=>1,'city_id'=>$city_id,"type in ($type_ids)" => null],'id desc','','',$fileds);
}
if($bizs_lists){
$bizs = array_column($bizs_lists,'biz_name');
+3 -1
View File
@@ -79,7 +79,9 @@ class Transfer extends Wxapp
if ($this->session['biz_id'] && $biz_id_arr) {
$bizs = $this->biz_model->get_by_id_arr($biz_id_arr, ['city_id' => $city_id, 'type<>' => 4], 'id');
} else {
$bizs = $this->biz_model->select(['status' => 1, 'city_id' => $city_id, 'type<>' => 4], 'id desc', '', '', 'id');
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$bizs = $this->biz_model->select(['status' => 1, 'city_id' => $city_id, "type in ($type_ids)" => null, 'type<>' => 4], 'id desc', '', '', 'id');
}
$biz_id_str = $bizs ? implode(',', array_column($bizs, 'id')) : 0;
$where = ['status <>' => -1, "biz_id in({$biz_id_str})" => null];
+3 -1
View File
@@ -473,7 +473,9 @@ class User extends Wxapp
$city_id && $o_where = ['city_id' => $city_id, 'type<>' => 4];
$bizs = $this->biz_model->get_by_id_arr($biz_id_arr, $o_where, $fileds);
} else {
$bizs = $this->biz_model->select(['status' => 1, 'city_id' => $city_id, 'type<>' => 4], 'id desc', '', '', $fileds);
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$bizs = $this->biz_model->select(['status' => 1, 'city_id' => $city_id, "type in ($type_ids)" => null, 'type<>' => 4], 'id desc', '', '', $fileds);
}
if ($bizs) {
foreach ($bizs as $key => $val) {
+6
View File
@@ -46,8 +46,11 @@ class Biz_model extends HD_Model
$bizs = [];
$ids = implode(',', $ids_arr);
if ($ids) {
$typeAry = $this->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$where = [
"id in ($ids)" => null,
"type in ($type_ids)" => null,
"status" => 1
];
is_array($o_where) && $where = array_merge($where, $o_where);
@@ -83,6 +86,9 @@ class Biz_model extends HD_Model
$lat = (float)$lat;
$lng = (float)$lng;
$where = "status=1 and lat>0 and lng>0";
$typeAry = $this->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$where = $where." and type in ($type_ids)";
if ($page) {
$offset = ($page - 1) * $size;