更新
This commit is contained in:
parent
b1f54af78d
commit
d320eeaba7
@ -46,9 +46,9 @@ class CompanyController extends BaseAdminController
|
|||||||
return $this->dataLists(new CompanyLists());
|
return $this->dataLists(new CompanyLists());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function list_two(){
|
public function list_two()
|
||||||
|
{
|
||||||
return $this->success('ok', (new CompanyLists())->list_two());
|
return $this->success('ok', (new CompanyLists())->list_two());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -234,4 +234,47 @@ class CompanyController extends BaseAdminController
|
|||||||
$data['lists'] = $result;
|
$data['lists'] = $result;
|
||||||
return $this->success('success', $data);
|
return $this->success('success', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function responsible_area()
|
||||||
|
{
|
||||||
|
$parmas = $this->request->param();
|
||||||
|
if (!isset($parmas['key']) && isset($parmas['key']) == '' || !isset($parmas['value']) && isset($parmas['value']) == '') {
|
||||||
|
return $this->fail('参数错误');
|
||||||
|
}
|
||||||
|
if ($parmas['key'] == 'city') {
|
||||||
|
$where[] = ['area', '=', 0];
|
||||||
|
}
|
||||||
|
$where[] = [$parmas['key'], '=', $parmas['value']];
|
||||||
|
switch ($parmas['key']) {
|
||||||
|
case 'city':
|
||||||
|
$where[] = ['area', '=', 0];
|
||||||
|
break;
|
||||||
|
case 'area':
|
||||||
|
$where[] = ['street', '=', 0];
|
||||||
|
break;
|
||||||
|
case 'street':
|
||||||
|
$where[] = ['village', '=', 0];
|
||||||
|
break;
|
||||||
|
case 'village':
|
||||||
|
$where[] = ['brigade', '=', 0];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$res = Company::where($where)->column('responsible_area');
|
||||||
|
foreach($res as $k=>$v){
|
||||||
|
$res[$k] = explode(',',$v);
|
||||||
|
}
|
||||||
|
$data=[];
|
||||||
|
foreach($res as $k=>$v){
|
||||||
|
foreach($v as $kk=>$vv){
|
||||||
|
if($vv != ''){
|
||||||
|
$data[] = $vv;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return $this->success('success', $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user