|
@@ -53,24 +53,24 @@ class CompanyController extends Controller
|
|
|
public function actionList()
|
|
public function actionList()
|
|
|
{
|
|
{
|
|
|
$filter = [
|
|
$filter = [
|
|
|
- 'is_del' => 0,
|
|
|
|
|
- 'phone' => Helper::getPostString('phone'),
|
|
|
|
|
- 'id' => $this->getcompanyFilter(),
|
|
|
|
|
|
|
+ 't.is_del' => 0,
|
|
|
|
|
+ 't.phone' => Helper::getPostString('phone'),
|
|
|
|
|
+ 't.id' => $this->getcompanyFilter(),
|
|
|
];
|
|
];
|
|
|
if ($name = Helper::getPostString('name')) {
|
|
if ($name = Helper::getPostString('name')) {
|
|
|
- $filter['name'] = '%' . $name;
|
|
|
|
|
|
|
+ $filter['t.name'] = '%' . $name;
|
|
|
}
|
|
}
|
|
|
$address = Helper::getArrParam($_POST, 'address', Helper::PARAM_KEY_TYPE['array_string']);
|
|
$address = Helper::getArrParam($_POST, 'address', Helper::PARAM_KEY_TYPE['array_string']);
|
|
|
- $filter['province'] = $address[0]?? null;
|
|
|
|
|
- $filter['city'] = $address[1]?? null;
|
|
|
|
|
- $filter['area'] = $address[2]?? null;
|
|
|
|
|
|
|
+ $filter['t.province'] = $address[0]?? null;
|
|
|
|
|
+ $filter['t.city'] = $address[1]?? null;
|
|
|
|
|
+ $filter['t.area'] = $address[2]?? null;
|
|
|
if ($school_id = Helper::getPostInt('school_id')) {
|
|
if ($school_id = Helper::getPostInt('school_id')) {
|
|
|
$cri = DbCriteria::simpleCompare(['school_id' => $school_id])->setSelect('company_id');
|
|
$cri = DbCriteria::simpleCompare(['school_id' => $school_id])->setSelect('company_id');
|
|
|
$ids = Helper::arrayColumn(
|
|
$ids = Helper::arrayColumn(
|
|
|
DB::getListWithCriteria('company_canteen_relation', $cri),
|
|
DB::getListWithCriteria('company_canteen_relation', $cri),
|
|
|
'company_id'
|
|
'company_id'
|
|
|
);
|
|
);
|
|
|
- $filter['id'] = $ids?: -1;
|
|
|
|
|
|
|
+ $filter['t.id'] = $ids?: -1;
|
|
|
}
|
|
}
|
|
|
// 被删除的关系要排除
|
|
// 被删除的关系要排除
|
|
|
$delContactIds = Helper::arrayColumn(DB::getListWithCriteria('wx_company_contact', DbCriteria::simpleCompare(['is_del' => 1])->setSelect('id')), 'id');
|
|
$delContactIds = Helper::arrayColumn(DB::getListWithCriteria('wx_company_contact', DbCriteria::simpleCompare(['is_del' => 1])->setSelect('id')), 'id');
|