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