1.提交缺失的东西

This commit is contained in:
2025-05-23 17:35:24 +08:00
parent 9738186efb
commit 01427a3fb3

View File

@ -40,7 +40,7 @@ class GoodsLogic extends BaseLogic
{ {
Db::startTrans(); Db::startTrans();
try { try {
Goods::create([ $id = Goods::insertGetId([
'name' => $params['name'], 'name' => $params['name'],
'code' => $params['code'], 'code' => $params['code'],
'first_category_id' => $params['first_category_id'], 'first_category_id' => $params['first_category_id'],
@ -87,7 +87,11 @@ class GoodsLogic extends BaseLogic
'is_express' => $params['is_express'], 'is_express' => $params['is_express'],
'is_selffetch' => $params['is_selffetch'] 'is_selffetch' => $params['is_selffetch']
]); ]);
foreach($params['goods_image'] as $key=>$value){
$d['goods_id'] = $id;
$d['uri'] = $value;
Db::name("goods_image")->save($d);
}
Db::commit(); Db::commit();
return true; return true;
} catch (\Exception $e) { } catch (\Exception $e) {