From c5ab197447f146ec9332037c8871959e72d734b8 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sat, 13 Jan 2024 14:39:14 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=95=86=E5=9F=8E=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=91=E5=85=AC=E5=8F=B8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/ShopCallController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/api/controller/ShopCallController.php b/app/api/controller/ShopCallController.php index 1e0f84c86..5aa4ee727 100644 --- a/app/api/controller/ShopCallController.php +++ b/app/api/controller/ShopCallController.php @@ -16,5 +16,12 @@ use think\facade\Log; */ class ShopCallController extends BaseApiController { - + public array $notNeedLogin = ['getVillageCompany']; + public function getVillageCompany() + { + $param = $this->request->param(); + $geoVillage = Db::name('geo_village')->where('village_id', $param['village_id'])->find(); + $company = Company::where(['village' =>$geoVillage['village_code'], 'company_type'=>17])->find(); + return $this->success('成功', compact('company')); + } } \ No newline at end of file From 1d85dcc2d52fd68b5fbaf0ebed9f2587e206c7cc Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sat, 13 Jan 2024 15:21:35 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=95=86=E5=9F=8E=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=91=E5=85=AC=E5=8F=B8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/ShopCallController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/api/controller/ShopCallController.php b/app/api/controller/ShopCallController.php index 5aa4ee727..c0730dfc3 100644 --- a/app/api/controller/ShopCallController.php +++ b/app/api/controller/ShopCallController.php @@ -3,6 +3,7 @@ namespace app\api\controller; use app\common\logic\task\TaskLogic; +use app\common\model\auth\Admin; use app\common\model\Company; use app\common\model\dict\DictData; use app\common\model\task\Task; @@ -22,6 +23,14 @@ class ShopCallController extends BaseApiController $param = $this->request->param(); $geoVillage = Db::name('geo_village')->where('village_id', $param['village_id'])->find(); $company = Company::where(['village' =>$geoVillage['village_code'], 'company_type'=>17])->find(); + $find= Admin::where('id', $company['admin_id'])->field('avatar,id_card')->find(); + if($find){ + $company['avatar']=$find['avatar']; + $company['id_card']=$find['id_card']; + }else{ + $company['avatar']=''; + $company['id_card']=''; + } return $this->success('成功', compact('company')); } } \ No newline at end of file From 364c45099afaa3e3d33b5742e22e12f4b1462511 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 23 Feb 2024 18:05:24 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=9F=A5=E5=8C=BA=E5=8E=BF=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CompanyController.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/app/api/controller/CompanyController.php b/app/api/controller/CompanyController.php index 83c21337c..566d3317f 100644 --- a/app/api/controller/CompanyController.php +++ b/app/api/controller/CompanyController.php @@ -355,13 +355,25 @@ class CompanyController extends BaseApiController * 查询镇农科公司 */ public function street_company(){ - $street=$this->request->param('street_code'); - $company=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$street], true); - if($company){ - return $this->success('ok',['title'=>$company[0]['company_name'],'organization_code'=>$company[0]['organization_code']]); - }else{ - return $this->fail('当前区域无镇农科公司'); + $street=$this->request->param('street_code', ''); + $area=$this->request->param('area_code', ''); + if (!empty($street)) { + $company=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$street], true); + if($company){ + return $this->success('ok',['title'=>$company[0]['company_name'],'organization_code'=>$company[0]['organization_code']]); + }else{ + return $this->fail('当前区域无镇农科公司'); + } } + if(!empty($area)) { + $company=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 15,'area'=>$area], true); + if($company){ + return $this->success('ok',['title'=>$company[0]['company_name'],'organization_code'=>$company[0]['organization_code']]); + }else{ + return $this->fail('当前区域无供投公司'); + } + } + } From 8eed8ad43ea97059e5fbee70488b53fa2e05d09d Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 23 Feb 2024 18:07:12 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=9F=A5=E5=8C=BA=E5=8E=BF=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CompanyController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/controller/CompanyController.php b/app/api/controller/CompanyController.php index 566d3317f..1e4167ac2 100644 --- a/app/api/controller/CompanyController.php +++ b/app/api/controller/CompanyController.php @@ -366,7 +366,7 @@ class CompanyController extends BaseApiController } } if(!empty($area)) { - $company=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 15,'area'=>$area], true); + $company=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:area,responsible_area)", ['company_type' => 15,'area'=>$area], true); if($company){ return $this->success('ok',['title'=>$company[0]['company_name'],'organization_code'=>$company[0]['organization_code']]); }else{ From 756fd5264dd2d12a40a5cf8d6823cea835259a55 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 23 Feb 2024 18:08:07 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=9F=A5=E5=8C=BA=E5=8E=BF=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CompanyController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/controller/CompanyController.php b/app/api/controller/CompanyController.php index 1e4167ac2..e64e5529b 100644 --- a/app/api/controller/CompanyController.php +++ b/app/api/controller/CompanyController.php @@ -366,7 +366,7 @@ class CompanyController extends BaseApiController } } if(!empty($area)) { - $company=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:area,responsible_area)", ['company_type' => 15,'area'=>$area], true); + $company=Db::query("select * from la_company where company_type=:company_type and area=:area)", ['company_type' => 15,'area'=>$area], true); if($company){ return $this->success('ok',['title'=>$company[0]['company_name'],'organization_code'=>$company[0]['organization_code']]); }else{ From d632a0e02315fb7b39b14777fe1e1762707ebb88 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 23 Feb 2024 18:10:56 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=9F=A5=E5=8C=BA=E5=8E=BF=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CompanyController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/controller/CompanyController.php b/app/api/controller/CompanyController.php index e64e5529b..cb972b541 100644 --- a/app/api/controller/CompanyController.php +++ b/app/api/controller/CompanyController.php @@ -366,9 +366,9 @@ class CompanyController extends BaseApiController } } if(!empty($area)) { - $company=Db::query("select * from la_company where company_type=:company_type and area=:area)", ['company_type' => 15,'area'=>$area], true); + $company= Company::where(['company_type'=>15, 'area'=>$area])->find()->toArray(); if($company){ - return $this->success('ok',['title'=>$company[0]['company_name'],'organization_code'=>$company[0]['organization_code']]); + return $this->success('ok',['title'=>$company['company_name'],'organization_code'=>$company['organization_code']]); }else{ return $this->fail('当前区域无供投公司'); } From eb987e1086db5638c0a0c0b941a74601d799319f Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 23 Feb 2024 18:11:43 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=9F=A5=E5=8C=BA=E5=8E=BF=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CompanyController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/controller/CompanyController.php b/app/api/controller/CompanyController.php index cb972b541..30f2991f5 100644 --- a/app/api/controller/CompanyController.php +++ b/app/api/controller/CompanyController.php @@ -366,7 +366,7 @@ class CompanyController extends BaseApiController } } if(!empty($area)) { - $company= Company::where(['company_type'=>15, 'area'=>$area])->find()->toArray(); + $company= Company::where(['company_type'=>15, 'area'=>$area])->findOrEmpty(); if($company){ return $this->success('ok',['title'=>$company['company_name'],'organization_code'=>$company['organization_code']]); }else{ From 28f8330db8cfcea0ea7f0aec578ff84eb63c3031 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 23 Feb 2024 18:12:26 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=9F=A5=E5=8C=BA=E5=8E=BF=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CompanyController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/controller/CompanyController.php b/app/api/controller/CompanyController.php index 30f2991f5..d3a8f74ee 100644 --- a/app/api/controller/CompanyController.php +++ b/app/api/controller/CompanyController.php @@ -367,7 +367,7 @@ class CompanyController extends BaseApiController } if(!empty($area)) { $company= Company::where(['company_type'=>15, 'area'=>$area])->findOrEmpty(); - if($company){ + if(!$company->isEmpty()){ return $this->success('ok',['title'=>$company['company_name'],'organization_code'=>$company['organization_code']]); }else{ return $this->fail('当前区域无供投公司');