|
@@ -24,20 +24,6 @@ class OrderGoodsClass extends BaseClass
|
|
|
const ACTION_WASTAGE = 'wastage'; //取消消耗花材
|
|
const ACTION_WASTAGE = 'wastage'; //取消消耗花材
|
|
|
const ACTION_WASTAGE_CANCEL = 'wastageCancel'; //取消消耗花材
|
|
const ACTION_WASTAGE_CANCEL = 'wastageCancel'; //取消消耗花材
|
|
|
|
|
|
|
|
- public static function addData($data, $custom)
|
|
|
|
|
- {
|
|
|
|
|
- $orderSn = $data['orderSn'] ?? '';
|
|
|
|
|
- $sjId = $data['sjId'] ?? 0;
|
|
|
|
|
- $shopId = $data['shopId'] ?? 0;
|
|
|
|
|
- $mainId = $data['mainId'] ?? 0;
|
|
|
|
|
- $goodsId = $data['goodsId'] ?? 0;
|
|
|
|
|
- $num = $data['num'] ?? 0;
|
|
|
|
|
- $customName = $custom['name'] ?? '';
|
|
|
|
|
- //减库存
|
|
|
|
|
- self::changeStockBySellGoods($orderSn, $sjId, $shopId, $mainId, $goodsId, $num, $customName);
|
|
|
|
|
- return self::add($data);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
//取订单 ssh 2020.1.2
|
|
//取订单 ssh 2020.1.2
|
|
|
public static function getGoodsListById($id)
|
|
public static function getGoodsListById($id)
|
|
|
{
|
|
{
|
|
@@ -215,11 +201,19 @@ class OrderGoodsClass extends BaseClass
|
|
|
return $stockInfo;
|
|
return $stockInfo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //销售成品库存变更方法(减库存)
|
|
|
|
|
- public static function changeStockBySellGoods($orderSn, $sjId, $shopId, $mainId, $goodsId, $goodsNum, $customName)
|
|
|
|
|
|
|
+ //花店商家自主开单,库存不足则不能开单
|
|
|
|
|
+ public static function addData($data, $custom)
|
|
|
{
|
|
{
|
|
|
- //减成品库存
|
|
|
|
|
- $respond = GoodsClass::decreaseStock($goodsId, $mainId, $goodsNum);
|
|
|
|
|
|
|
+ $orderSn = $data['orderSn'] ?? '';
|
|
|
|
|
+ $sjId = $data['sjId'] ?? 0;
|
|
|
|
|
+ $shopId = $data['shopId'] ?? 0;
|
|
|
|
|
+ $mainId = $data['mainId'] ?? 0;
|
|
|
|
|
+ $goodsId = $data['goodsId'] ?? 0;
|
|
|
|
|
+ $num = $data['num'] ?? 0;
|
|
|
|
|
+ $customName = $custom['name'] ?? '';
|
|
|
|
|
+
|
|
|
|
|
+ //搜索关键词GoodsStockRecordClass::sellGoods,可以找到相同的方法
|
|
|
|
|
+ $respond = GoodsClass::decreaseStock($goodsId, $mainId, $num);
|
|
|
$oldStock = $respond['oldStock'] ?? 0;
|
|
$oldStock = $respond['oldStock'] ?? 0;
|
|
|
$newStock = $respond['newStock'] ?? 0;
|
|
$newStock = $respond['newStock'] ?? 0;
|
|
|
$data = [];
|
|
$data = [];
|
|
@@ -228,14 +222,16 @@ class OrderGoodsClass extends BaseClass
|
|
|
$data['mainId'] = $mainId;
|
|
$data['mainId'] = $mainId;
|
|
|
$data['orderSn'] = $orderSn;
|
|
$data['orderSn'] = $orderSn;
|
|
|
$data['goodsId'] = $goodsId;
|
|
$data['goodsId'] = $goodsId;
|
|
|
- $data['goodsNum'] = $goodsNum;
|
|
|
|
|
|
|
+ $data['goodsNum'] = $num;
|
|
|
$data['oldStock'] = $oldStock;
|
|
$data['oldStock'] = $oldStock;
|
|
|
$data['newStock'] = $newStock;
|
|
$data['newStock'] = $newStock;
|
|
|
$data['relateName'] = $customName;
|
|
$data['relateName'] = $customName;
|
|
|
GoodsStockRecordClass::sellGoods($data);
|
|
GoodsStockRecordClass::sellGoods($data);
|
|
|
- return true;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ return self::add($data);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
//制作工单消耗花材(批量)
|
|
//制作工单消耗花材(批量)
|
|
|
//消耗花材信息:$consumeItemInfo = [{"id":12233,"num":1,"unitType":0}]
|
|
//消耗花材信息:$consumeItemInfo = [{"id":12233,"num":1,"unitType":0}]
|
|
|
public static function consumeItemByMakeGoodsBatch($orderSn, $sjId, $shopId, $consumeItemInfo)
|
|
public static function consumeItemByMakeGoodsBatch($orderSn, $sjId, $shopId, $consumeItemInfo)
|