|
|
@@ -11,6 +11,7 @@ use biz\item\classes\PtItemClass;
|
|
|
use bizGhs\custom\classes\CustomClass;
|
|
|
use bizGhs\item\classes\ItemClassClass;
|
|
|
use bizGhs\merchant\classes\ShopClass;
|
|
|
+use bizGhs\order\classes\PurchaseOrderClass;
|
|
|
use bizGhs\product\classes\ProductClass;
|
|
|
use bizGhs\product\models\Product;
|
|
|
use bizGhs\product\services\ProductService;
|
|
|
@@ -507,6 +508,22 @@ class ProductController extends BaseController
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
|
|
|
+ $cg = PurchaseOrderClass::getLockById($targetId);
|
|
|
+ if (!empty($cg)) {
|
|
|
+ if (isset($cg->mainId) == false || $cg->mainId != $this->mainId) {
|
|
|
+ util::fail('不是您的采购单');
|
|
|
+ }
|
|
|
+ //批量改价同时入库
|
|
|
+ if ($cg->status == PurchaseOrderClass::PURCHASE_ORDER_STATUS_SENDING) {
|
|
|
+ $staff = $this->shopAdmin;
|
|
|
+ $data = [];
|
|
|
+ $data['staffId'] = $staff->id ?? 0;
|
|
|
+ $data['staffName'] = $staff->name ?? '';
|
|
|
+ $data['adminId'] = $this->adminId ?? 0;
|
|
|
+ PurchaseOrderClass::putIn($cg, $data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$ids = array_column($arr, 'id');
|
|
|
$ids = array_unique(array_filter($ids));
|
|
|
if (empty($ids)) {
|