mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
feat: #10000 导入修改
This commit is contained in:
parent
12b734e916
commit
ec7704bbb2
@ -333,8 +333,10 @@ class GoodsSkusController extends Controller
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$collection = Excel::import(new GoodsSkusImport(), $request->file('goodsSkus'));
|
$import = new GoodsSkusImport();
|
||||||
$this->setAfterUpdate($collection->toArray());
|
$path = $request->file('goodsSkus');
|
||||||
|
Excel::import($import, $path);
|
||||||
|
$this->setAfterUpdate('');
|
||||||
$this->addLog(0, 'import');
|
$this->addLog(0, 'import');
|
||||||
} catch (ValidationException $exception) {
|
} catch (ValidationException $exception) {
|
||||||
$this->setValidatorFailResponse($exception->validator->getMessageBag()->getMessages());
|
$this->setValidatorFailResponse($exception->validator->getMessageBag()->getMessages());
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class GoodsSkusImport implements ToCollection, SkipsEmptyRows
|
|||||||
'*.0' => ['required', 'string', 'max:255'],
|
'*.0' => ['required', 'string', 'max:255'],
|
||||||
'*.1' => ['required', 'string', 'max:255', 'exists:goods_types,name'],
|
'*.1' => ['required', 'string', 'max:255', 'exists:goods_types,name'],
|
||||||
'*.2' => ['string', 'max:255', 'exists:goods_brands,name'],
|
'*.2' => ['string', 'max:255', 'exists:goods_brands,name'],
|
||||||
'*.3' => ['required', 'alpha_dash', 'max:32', 'unique:goods,goods_code'],
|
'*.3' => ['required', 'alpha_dash', 'max:32'],
|
||||||
'*.4' => ['required', 'string', 'max:255'],
|
'*.4' => ['required', 'string', 'max:255'],
|
||||||
'*.5' => ['required', 'distinct', 'alpha_dash', 'max:32'],
|
'*.5' => ['required', 'distinct', 'alpha_dash', 'max:32'],
|
||||||
'*.6' => ['required', 'string', Rule::in(['下架', '在售', '预警'])],
|
'*.6' => ['required', 'string', Rule::in(['下架', '在售', '预警'])],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user