From 5e08f9359c2cd52916c46f24605ba029195f83b1 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 13 Jun 2024 10:27:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E6=88=B7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/store/StoreController.php | 18 ++++++++++++- app/api/logic/store/StoreLogic.php | 27 ++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 app/api/logic/store/StoreLogic.php diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index dde6ba987..6b4dd010d 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -4,6 +4,7 @@ namespace app\api\controller\store; use app\api\lists\store\SystemStoreLists; use app\api\controller\BaseApiController; +use app\api\logic\store\StoreLogic; use app\common\service\pay\PayService; use Webman\Config; use hg\apidoc\annotation as ApiDoc; @@ -11,11 +12,26 @@ use hg\apidoc\annotation as ApiDoc; class StoreController extends BaseApiController { - + public $notNeedLogin = ['detail']; public function lists() { return $this->dataLists(new SystemStoreLists()); } + public function detail() + { + $store_id = (int)$this->request->get('store_id'); + $where = [ + 'id' => $store_id + ]; + $info = StoreLogic::search($where); + if ($info) { + return $this->data($info); + } else { + return $this->fail('店铺不存在'); + } + } + + } diff --git a/app/api/logic/store/StoreLogic.php b/app/api/logic/store/StoreLogic.php new file mode 100644 index 000000000..f9fd39616 --- /dev/null +++ b/app/api/logic/store/StoreLogic.php @@ -0,0 +1,27 @@ +field(['id', 'name', 'phone', 'detailed_address', 'image', 'is_show', + 'day_time', 'is_store', 'latitude', 'longitude', 'day_start', 'day_end', 'is_store' + , 'is_send' + ]) + ->find() + ->toArray(); + + + } + + +} \ No newline at end of file