|
@@ -672,6 +672,11 @@ class OrderOutChild extends Base
|
|
|
'holder_id' => $sale[$child[$value['outChildCode']]['orderCode']]['cgderid']
|
|
|
]);
|
|
|
|
|
|
+ $stock = Db::name('good_stock') ->where(['is_del' => 0, 'spuCode' => $sale[$child[$value['outChildCode']]['orderCode']]['good_code'], 'wsm_code' => $child[$value['outChildCode']]['wsm_code']])->findOrEmpty();
|
|
|
+ if(empty($stock))throw new \Exception('商品库存数未找到');
|
|
|
+ if($stock['wait_out_stock']<$child[$value['outChildCode']]['num']){
|
|
|
+ throw new \Exception('商品库存数待出库不足');
|
|
|
+ }
|
|
|
//库存
|
|
|
$stock_up= Db::name('good_stock')
|
|
|
->data(['updatetime' => $date])
|
|
@@ -692,12 +697,6 @@ class OrderOutChild extends Base
|
|
|
foreach ($yz_tmp as $temp) {
|
|
|
curl_request(config('app.yz_domain') . 'api/yz_out_send', ['orderCode' => $temp['orderCode'], 'out_stype' => $temp['post_name'], 'post_code' => $temp['post_code'], 'uid' => $this->uid, 'uname' => $this->uname, 'order_out' => $temp['outCode']]);
|
|
|
}
|
|
|
-// if ($einfo['order_source'] == 5) {
|
|
|
-// $res = curl_request(config('app.yz_domain') . 'api/yz_out_send', ['orderCode' => $einfo['orderCode'], 'out_stype' => $post_name, 'post_code' => $post_code, 'uid' => $uid, 'uname' => $uname, 'order_out' => $outCode]);
|
|
|
-// $res = json_decode($res, true);
|
|
|
-// if ($res['code'] != 0) return app_show(0, '发货成功,' . $res['message']);
|
|
|
-// }
|
|
|
-
|
|
|
return json_show(0, '操作完成');
|
|
|
|
|
|
} catch (Exception $exception) {
|