feat: sku
This commit is contained in:
@@ -144,12 +144,10 @@ class GoodController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* cycle 列表
|
* cycle 列表
|
||||||
* @param GoodRequest $request
|
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
#[RequestMapping(path: "list_cycle", methods: "POST")]
|
#[RequestMapping(path: "list_cycle", methods: "GET")]
|
||||||
#[Scene(scene: "list_cycle")]
|
public function cycleList(): array
|
||||||
public function cycleList(GoodRequest $request): array
|
|
||||||
{
|
{
|
||||||
return (new CycleService)->handle();
|
return (new CycleService)->handle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,10 +46,11 @@ class GoodRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected array $scenes = [
|
protected array $scenes = [
|
||||||
'add_spu' => ['date', 'kitchen_id', 'chef_id', 'title', 'sub_title', 'category_id', 'saleable'],
|
'list_cycle' => [],
|
||||||
|
'add_spu' => ['cycle_id', 'kitchen_id', 'chef_id', 'title', 'sub_title', 'category_id', 'saleable'],
|
||||||
'edit_spu' => ['id','kitchen_id', 'chef_id', 'title', 'sub_title', 'category_id', 'saleable'],
|
'edit_spu' => ['id','kitchen_id', 'chef_id', 'title', 'sub_title', 'category_id', 'saleable'],
|
||||||
'del_spu' => ['id'],
|
'del_spu' => ['id'],
|
||||||
'spu' => ['id'],
|
'spu' => ['id'],
|
||||||
'list_spu' => ['cycle_id']
|
'list_spu' => ['cycle_id'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class CycleService extends BaseService
|
|||||||
$arr = $this->cycleModel->whereBetween('dates',[
|
$arr = $this->cycleModel->whereBetween('dates',[
|
||||||
date('Y-m-d',strtotime('-10 day',time())),
|
date('Y-m-d',strtotime('-10 day',time())),
|
||||||
date('Y-m-d',strtotime('+10 day',time())),
|
date('Y-m-d',strtotime('+10 day',time())),
|
||||||
])->orderBy('dates')->get();
|
])->orderBy('dates')->select(['id','dates'])->get();
|
||||||
if (empty($arr)) return $this->return->success('success',['list' => []]);
|
if (empty($arr)) return $this->return->success('success',['list' => []]);
|
||||||
|
|
||||||
$arr = $arr->toArray();
|
$arr = $arr->toArray();
|
||||||
|
|||||||
@@ -78,10 +78,9 @@ class SpuService extends BaseService
|
|||||||
*/
|
*/
|
||||||
public function add(): array
|
public function add(): array
|
||||||
{
|
{
|
||||||
$date = $this->request->input('date',date('Y-m-d'));
|
$cycleId = (int)$this->request->input('cycle_id');
|
||||||
|
|
||||||
$cycleInfo = $this->cycleModel->getInfoByDate($date);
|
|
||||||
|
|
||||||
|
$cycleInfo = $this->cycleModel->getInfoById($cycleId);
|
||||||
if (empty($cycleInfo)) throw new ErrException('没有该周期,请刷新后重新上传');
|
if (empty($cycleInfo)) throw new ErrException('没有该周期,请刷新后重新上传');
|
||||||
|
|
||||||
$title = $this->request->input('title');
|
$title = $this->request->input('title');
|
||||||
|
|||||||
14
sync/http/admin/good.http
Normal file
14
sync/http/admin/good.http
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
### 登录
|
||||||
|
POST {{host}}/admin/login/user
|
||||||
|
Content-Type: application/x-www-form-urlencoded
|
||||||
|
|
||||||
|
account=13632877014&password=123456
|
||||||
|
|
||||||
|
> {%
|
||||||
|
client.global.set("admin_token", response.body.data.token);
|
||||||
|
%}
|
||||||
|
|
||||||
|
### 周期列表
|
||||||
|
GET {{host}}/admin/good/list_cycle
|
||||||
|
Content-Type: application/x-www-form-urlencoded
|
||||||
|
Authorization: Bearer {{admin_token}}
|
||||||
Reference in New Issue
Block a user