暂时回滚采购单
This commit is contained in:
parent
9de998ec83
commit
bdc290c6b1
@ -678,7 +678,7 @@ class BeforehandOrderLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
$order_info = new OrderInfo();
|
$order_info = new OrderInfo();
|
||||||
$order = BeforehandOrder::where('id', $params['id'])->find();
|
$order = BeforehandOrder::where('id', $params['id'])->find();
|
||||||
if ($order['order_type'] == 7 && $params['print'] == 1) {
|
if ($order['order_type'] == 7 && isset($params['print']) && $params['print'] == 1) {
|
||||||
$order->is_buying = 1;
|
$order->is_buying = 1;
|
||||||
$order->save();
|
$order->save();
|
||||||
}
|
}
|
||||||
|
@ -41,23 +41,13 @@ class PurchaseProductOfferLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$procurementOrder = BeforehandOrder::where('order_type', 7)->where('is_buying', 0)->find();
|
|
||||||
if (empty($procurementOrder)) {
|
|
||||||
$beforeOrder = BeforehandOrder::where('id', $params['order_id'])->findOrEmpty()->toArray();
|
|
||||||
unset($beforeOrder['id'], $beforeOrder['create_time'], $beforeOrder['update_time']);
|
|
||||||
$procurementOrder = new BeforehandOrder();
|
|
||||||
$procurementOrder->setAttrs($beforeOrder);
|
|
||||||
$procurementOrder->order_id = getNewOrderId('CG');
|
|
||||||
$procurementOrder->order_type = 7;
|
|
||||||
$procurementOrder->save();
|
|
||||||
}
|
|
||||||
$mark = $params['mark'] ?? '';
|
$mark = $params['mark'] ?? '';
|
||||||
if ($mark == '') {
|
if ($mark == '') {
|
||||||
$mark = BeforehandOrderCartInfo::where('bhoid', $params['order_id'])->where('product_id', $params['product_id'])->value('mark');
|
$mark = BeforehandOrderCartInfo::where('bhoid', $params['order_id'])->where('product_id', $params['product_id'])->value('mark');
|
||||||
}
|
}
|
||||||
$find=StoreProduct::where('id',$params['product_id'])->find();
|
$find=StoreProduct::where('id',$params['product_id'])->find();
|
||||||
PurchaseProductOffer::create([
|
PurchaseProductOffer::create([
|
||||||
'order_id' => $procurementOrder['id'],
|
'order_id' => $params['order_id'],
|
||||||
'product_id' => $params['product_id'],
|
'product_id' => $params['product_id'],
|
||||||
'unit' => $params['unit'],
|
'unit' => $params['unit'],
|
||||||
'is_buyer' => $params['is_buyer'],
|
'is_buyer' => $params['is_buyer'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user