|
@@ -170,7 +170,8 @@ class Package extends BaseModel
|
|
|
$data['status'] = -1;
|
|
|
$data['re'] = $re;
|
|
|
$last_id = self::where('id',$id)->value('last_id');
|
|
|
- if($last_id>0) self::edit(['status'=>2],$last_id);
|
|
|
+ $info = self::find($id);
|
|
|
+ if($last_id>0) self::edit(['status'=>2],$last_id); else StoreWholesale::where('id',$info['whole_id'])->dec('sales',1)->inc('stock',1)->update();
|
|
|
return self::edit($data,$id);
|
|
|
}
|
|
|
|