1.提交缺失的东西
This commit is contained in:
@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user