|
@@ -21,7 +21,7 @@ class companylogic extends baselogic
|
|
|
{
|
|
|
$list = [
|
|
|
'auditcompany' => [
|
|
|
- ['name' => 'ids', 'title' => 'id', 'require' => true, 'type' => 'array'],
|
|
|
+ ['name' => 'idlist', 'title' => 'idlist', 'require' => true, 'type' => 'array'],
|
|
|
['name' => 'ispass', 'title' => 'ispass', 'require' => true, 'type' => 'numeric', 'regex' => '/[1|2]{1}/'],
|
|
|
],
|
|
|
'getlistbywhere' => [
|
|
@@ -45,7 +45,7 @@ class companylogic extends baselogic
|
|
|
if (1 != $result['status']) {
|
|
|
return $result;
|
|
|
}
|
|
|
- $ids = $arr['ids'];
|
|
|
+ $ids = $arr['idlist'];
|
|
|
if (is_string($ids)) {
|
|
|
$ids = [$ids];
|
|
|
}
|
|
@@ -77,6 +77,7 @@ class companylogic extends baselogic
|
|
|
*/
|
|
|
public function getlistbywhere($arr)
|
|
|
{
|
|
|
+ $arr = $this->filterarray($arr);
|
|
|
$result = $this->checkparam(__FUNCTION__, $arr);
|
|
|
if (1 != $result['status']) {
|
|
|
return $result;
|
|
@@ -90,8 +91,10 @@ class companylogic extends baselogic
|
|
|
}
|
|
|
if (isset($arr['createdate'])) {
|
|
|
$createdate = $arr['createdate'];
|
|
|
- $where[] = ['create_time', '>=', $createdate[0]];
|
|
|
- $where[] = ['create_time', '<=', $createdate[1]];
|
|
|
+ if (count($createdate) == count(array_filter($createdate))) {
|
|
|
+ $where[] = ['create_time', '>=', $createdate[0]];
|
|
|
+ $where[] = ['create_time', '<=', $createdate[1]];
|
|
|
+ }
|
|
|
}
|
|
|
$m_c = new companymodel();
|
|
|
$count = $m_c->getList($where, 'count');
|
|
@@ -101,6 +104,57 @@ class companylogic extends baselogic
|
|
|
$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);
|
|
|
+ $data = [
|
|
|
+ 'list' => $list,
|
|
|
+ 'total' => $count,
|
|
|
+ ];
|
|
|
+ return backarr(1, "查询成功", $data);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据id获取企业信息
|
|
|
+ * 20220209
|
|
|
+ * wj
|
|
|
+ */
|
|
|
+ public function getinfobyid($arr)
|
|
|
+ {
|
|
|
+ $arr = $this->filterarray($arr);
|
|
|
+ $result = $this->checkparam(__FUNCTION__, $arr);
|
|
|
+ if (1 != $result['status']) {
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+ $where = [];
|
|
|
+ $id = $arr['id'];
|
|
|
+ $where['id'] = $id;
|
|
|
+ $m_c = new companymodel();
|
|
|
+ $info = $m_c->getInfo($where);
|
|
|
+ if (empty($info)) {
|
|
|
+ return backarr(0, "无数据");
|
|
|
+ }
|
|
|
+ $info = $this->formatinfo($info);
|
|
|
+ return backarr(1, "success", $info);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 格式化企业信息
|
|
|
+ * 20220209
|
|
|
+ * wj
|
|
|
+ */
|
|
|
+ private function formatinfo($info)
|
|
|
+ {
|
|
|
+ if (isset($info['enterprisephoto']) && is_string($info['enterprisephoto'])) {
|
|
|
+ if (!empty($info['enterprisephoto'])) {
|
|
|
+ $jsonArr = json_decode($info['enterprisephoto'], true);
|
|
|
+ /*$pregstr = '/^(http:\/\/*)|(https:\/\/*)/';
|
|
|
+ foreach ($jsonArr as $key => $value) {
|
|
|
+ $matchResult = preg_match($pregstr, $value, $matchArr);
|
|
|
+ if ($matchResult) {
|
|
|
+ foreach ($matchArr as $mkey => $mvalue) {
|
|
|
+ $jsonArr[$key] = str_replace($mvalue, "", $value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ $info['enterprisephoto'] = $jsonArr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $info;
|
|
|
}
|
|
|
}
|