新增商户查询接口
This commit is contained in:
parent
c88b37c25e
commit
5e08f9359c
@ -4,6 +4,7 @@ namespace app\api\controller\store;
|
|||||||
|
|
||||||
use app\api\lists\store\SystemStoreLists;
|
use app\api\lists\store\SystemStoreLists;
|
||||||
use app\api\controller\BaseApiController;
|
use app\api\controller\BaseApiController;
|
||||||
|
use app\api\logic\store\StoreLogic;
|
||||||
use app\common\service\pay\PayService;
|
use app\common\service\pay\PayService;
|
||||||
use Webman\Config;
|
use Webman\Config;
|
||||||
use hg\apidoc\annotation as ApiDoc;
|
use hg\apidoc\annotation as ApiDoc;
|
||||||
@ -11,11 +12,26 @@ use hg\apidoc\annotation as ApiDoc;
|
|||||||
|
|
||||||
class StoreController extends BaseApiController
|
class StoreController extends BaseApiController
|
||||||
{
|
{
|
||||||
|
public $notNeedLogin = ['detail'];
|
||||||
public function lists()
|
public function lists()
|
||||||
{
|
{
|
||||||
return $this->dataLists(new SystemStoreLists());
|
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('店铺不存在');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
27
app/api/logic/store/StoreLogic.php
Normal file
27
app/api/logic/store/StoreLogic.php
Normal 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();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user