新增商户查询接口

This commit is contained in:
liu 2024-06-13 10:27:56 +08:00
parent c88b37c25e
commit 5e08f9359c
2 changed files with 44 additions and 1 deletions

View File

@ -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('店铺不存在');
}
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\api\logic\store;
use app\common\logic\BaseLogic;
use app\common\model\system_store\SystemStore;
use think\facade\Db;
class StoreLogic extends BaseLogic
{
public static function search($param)
{
return SystemStore::where($param)
->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();
}
}