|
@@ -182,7 +182,8 @@ class Goods extends Controller
|
|
*/
|
|
*/
|
|
public function goods_edit(){
|
|
public function goods_edit(){
|
|
$goods_id = input('goods_id');
|
|
$goods_id = input('goods_id');
|
|
-
|
|
|
|
|
|
+ $goods = ShopGoods::mk()->where('id',$goods_id)->find();
|
|
|
|
+ if($goods['examine'] == 0)$this->error('商品审核中暂不支持编辑');
|
|
$data = $this->_vali(
|
|
$data = $this->_vali(
|
|
[
|
|
[
|
|
'name.require'=>'商品名称不能为空',
|
|
'name.require'=>'商品名称不能为空',
|
|
@@ -207,6 +208,7 @@ class Goods extends Controller
|
|
'data_items'=>$data['items'],
|
|
'data_items'=>$data['items'],
|
|
'status'=>$data['status'],
|
|
'status'=>$data['status'],
|
|
'create_at'=>date('Y-m-d H:i:s'),
|
|
'create_at'=>date('Y-m-d H:i:s'),
|
|
|
|
+ 'examine'=>0,
|
|
];
|
|
];
|
|
Db::startTrans();
|
|
Db::startTrans();
|
|
try {
|
|
try {
|
|
@@ -225,12 +227,12 @@ class Goods extends Controller
|
|
ShopGoodsItem::mk()->where('id',$v['id'])->save($item_data);
|
|
ShopGoodsItem::mk()->where('id',$v['id'])->save($item_data);
|
|
}
|
|
}
|
|
Db::commit();
|
|
Db::commit();
|
|
- $this->success('商品数据入库成功!');
|
|
|
|
|
|
+ $this->success('商品数据编辑成功!');
|
|
|
|
|
|
|
|
|
|
}catch (ErrorException $e){
|
|
}catch (ErrorException $e){
|
|
Db::rollback();
|
|
Db::rollback();
|
|
- $this->success('商品数据入库失败!'.$e);
|
|
|
|
|
|
+ $this->success('商品数据编辑失败!'.$e);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|