edit-api-attr_status

This commit is contained in:
lccsw
2022-07-04 15:05:51 +08:00
parent dca0254b3c
commit 1d562bad93
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ class Series extends Wxapp{
$rows = $this->auto_cars_model->select($where,'id desc',$page,$size,'id,s_id,v_id');
if($rows){
$target_arr = array_unique(array_column($rows,'v_id'));
$attrs = $this->auto_attr_model->get_map_by_ids($target_arr,'id,title');
$attrs = $this->auto_attr_model->get_map_by_ids($target_arr,'id,title',1);
foreach($attrs as $key => $val){
$lists[] = [
'id' => $key,
+2 -2
View File
@@ -24,16 +24,16 @@ class Auto_attr_model extends HD_Model{
* @param string $fileds
* @return array
*/
public function get_map_by_ids($ids, $fileds = '')
public function get_map_by_ids($ids, $fileds = '',$status='')
{
$rows = [];
$ids = array_filter($ids);
if ($ids) {
$cf_ids = implode(',', $ids);
$where = [
"status" => 1,
"id in ($cf_ids)" => null
];
strlen($status) && $where['status'] = $status;
$rows = $this->map('id', '', $where, '', '', '', $fileds);
}
return $rows;