|
|
@@ -95,17 +95,27 @@ class ItemService extends BaseService
|
|
|
util::fail("成本价不能小于0");
|
|
|
}
|
|
|
|
|
|
+ $model = self::getById($id);
|
|
|
+ if(!$model){
|
|
|
+ util::fail("该花材不存在");
|
|
|
+ }
|
|
|
+ if($model['merchantId'] !== $data['merchantId']){
|
|
|
+ util::fail("参数错误");
|
|
|
+ }
|
|
|
+
|
|
|
ItemClass::updateGshItem($id,$stockWarning,$unitAddPrice,$unitWeight,$unitCost);
|
|
|
}
|
|
|
|
|
|
//删除花材,同时修改itemInfo 的状态值 delStatus = 1
|
|
|
- public static function deleteGhsItem($id,$shopId,$adminId)
|
|
|
+ public static function deleteGhsItem($id,$shopId,$sjId,$adminId)
|
|
|
{
|
|
|
$model = ItemClass::getById($id);
|
|
|
if(!$model){
|
|
|
util::fail("该花材不存在");
|
|
|
}
|
|
|
-
|
|
|
+ if($model['merchantId'] !== $sjId){
|
|
|
+ util::fail("参数错误");
|
|
|
+ }
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try{
|