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