[ ['name' => 'ids', 'title' => 'id', 'require' => true, 'type' => 'array'], ['name' => 'ispass', 'title' => 'ispass', 'require' => true, 'type' => 'numeric', 'regex' => '/[1|2]{1}/'], ], 'getlistbywhere' => [ ['name' => 'ispass', 'title' => 'ispass', 'type' => 'numeric', 'regex' => '/[0|1|2]{1}/'], ['name' => 'companyname', 'title' => 'companyname', 'type' => 'string'], ['name' => 'createdate', 'title' => 'createdate', 'type' => 'array'], ['name' => 'page', 'title' => 'page', 'type' => 'numeric'], ['name' => 'size', 'title' => 'size', 'type' => 'numeric'], ], ]; return $list; } /** * 审核公司 * 20220208 * wj */ public function auditcompany($arr) { $result = $this->checkparam(__FUNCTION__, $arr); if (1 != $result['status']) { return $result; } $ids = $arr['ids']; if (is_string($ids)) { $ids = [$ids]; } $ispass = $arr['ispass']; $m_c = new companymodel(); $successIds = []; foreach ($ids as $key => $value) { $where = ['id' => $value]; $info = $m_c->getInfo($where); if (empty($info)) { log::error("company_id " . $value . " 无对应企业"); continue; } if ($ispass != $info['ispass']) { $successIds[] = $value; $update = ['ispass' => $ispass]; $m_c->updateinfo($where, $update); } } $data = [ 'successIds' => $successIds, ]; return backarr(1, "操作成功", $data); } /** * 获取公司列表 * 20220208 * wj */ public function getlistbywhere($arr) { $result = $this->checkparam(__FUNCTION__, $arr); if (1 != $result['status']) { return $result; } $where = []; if (isset($arr['ispass'])) { $where[] = ['ispass', '=', $arr['ispass']]; } if (isset($arr['companyname'])) { $where[] = ['companyname', 'like', '%' . $arr['companyname'] . '%']; } if (isset($arr['createdate'])) { $createdate = $arr['createdate']; $where[] = ['create_time', '>=', $createdate[0]]; $where[] = ['create_time', '<=', $createdate[1]]; } $m_c = new companymodel(); $count = $m_c->getList($where, 'count'); if ($count <= 0) { return backarr(0, "无数据"); } $page = isset($arr['page']) && !empty($arr['page']) ? $arr['page'] : 1; $size = isset($arr['size']) && !empty($arr['size']) ? $arr['size'] : 10; $list = $m_c->getList($where, '*', $page, $size); return backarr(1, "查询成功", $list); } }