添加门店设置
This commit is contained in:
parent
f5da7a4359
commit
94309ff28d
@ -15,8 +15,10 @@
|
||||
namespace app\store\controller;
|
||||
|
||||
use app\admin\logic\ConfigLogic;
|
||||
use think\facade\Db;
|
||||
use app\admin\logic\system_store\SystemStoreLogic;
|
||||
use app\common\controller\Definitions;
|
||||
use hg\apidoc\annotation as ApiDoc;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 配置控制器
|
||||
@ -34,6 +36,7 @@ class ConfigController extends BaseAdminController
|
||||
ApiDoc\url('/store/config/getConfig'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\ResponseSuccess("data", type: "array", children: [
|
||||
['name' => 'oss_domain', 'desc' => 'oss域名', 'type' => 'string'],
|
||||
['name' => 'web_name', 'desc' => '站点名称', 'type' => 'string'],
|
||||
@ -49,20 +52,47 @@ class ConfigController extends BaseAdminController
|
||||
return $this->data($data);
|
||||
}
|
||||
|
||||
|
||||
public function dict()
|
||||
#[
|
||||
ApiDoc\Title('门店配置'),
|
||||
ApiDoc\url('/store/config/store'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
]
|
||||
public function store()
|
||||
{
|
||||
$type = $this->request->get('type', '');
|
||||
$data = ConfigLogic::getDictByType($type);
|
||||
return $this->data($data);
|
||||
$params['id'] = $this->request->adminInfo['store_id'];
|
||||
$result = SystemStoreLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
#[
|
||||
ApiDoc\Title('省列表'),
|
||||
ApiDoc\url('/store/config/province'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
]
|
||||
public function province()
|
||||
{
|
||||
$list = Db::name('geo_province')->select()->toArray();
|
||||
return $this->success('ok', $list);
|
||||
}
|
||||
|
||||
#[
|
||||
ApiDoc\Title('市列表'),
|
||||
ApiDoc\url('/store/config/city'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Query(name: 'code', type: 'int', require: true, desc: '省份代码'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
]
|
||||
public function city()
|
||||
{
|
||||
$province_code = $this->request->get('code');
|
||||
@ -70,6 +100,16 @@ class ConfigController extends BaseAdminController
|
||||
return $this->success('ok', $list);
|
||||
}
|
||||
|
||||
#[
|
||||
ApiDoc\Title('区列表'),
|
||||
ApiDoc\url('/store/config/area'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Query(name: 'code', type: 'int', require: true, desc: '城市代码'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
]
|
||||
public function area()
|
||||
{
|
||||
$city_code = $this->request->get('code');
|
||||
@ -77,11 +117,4 @@ class ConfigController extends BaseAdminController
|
||||
return $this->success('ok', $list);
|
||||
}
|
||||
|
||||
public function street()
|
||||
{
|
||||
$area_code = $this->request->get('code');
|
||||
$list = Db::name('geo_street')->where('area_code', $area_code)->select()?->toArray();
|
||||
return $this->success('ok', $list);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ class DeliveryController extends BaseAdminController
|
||||
ApiDoc\url('/store/delivery/add'),
|
||||
ApiDoc\Method('POST'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
|
||||
ApiDoc\Param(name: 'nickname', type: 'string', require: true, desc: '店员名称'),
|
||||
@ -51,6 +52,7 @@ class DeliveryController extends BaseAdminController
|
||||
ApiDoc\url('/store/delivery/edit'),
|
||||
ApiDoc\Method('POST'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\Param(name: 'avatar', type: 'string', require: true, desc: '头像'),
|
||||
@ -72,6 +74,7 @@ class DeliveryController extends BaseAdminController
|
||||
ApiDoc\url('/store/delivery/delete'),
|
||||
ApiDoc\Method('POST'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
@ -88,6 +91,7 @@ class DeliveryController extends BaseAdminController
|
||||
ApiDoc\url('/store/delivery/detail'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\Query(name: 'id', type: 'int', require: true, desc: 'id'),
|
||||
ApiDoc\ResponseSuccess("data", type: "array", children: [
|
||||
@ -115,6 +119,7 @@ class DeliveryController extends BaseAdminController
|
||||
ApiDoc\url('/store/delivery/status'),
|
||||
ApiDoc\Method('POST'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user