|
|
@@ -525,33 +525,33 @@ class PurchaseOrderController extends BaseController
|
|
|
}
|
|
|
//不是待入库状态不需要分配
|
|
|
if ($cg->status != 3) {
|
|
|
- util::success(['hint' => 'cg is no wait for entry']);
|
|
|
+ util::success(['assign' => 0, 'hint' => 'cg is no wait for entry']);
|
|
|
}
|
|
|
$cgBookSn = $cg->bookSn ?? 0;
|
|
|
if (empty($cgBookSn)) {
|
|
|
- util::success(['hint' => 'cg bookSn is empty']);
|
|
|
+ util::success(['assign' => 0, 'hint' => 'cg bookSn is empty']);
|
|
|
}
|
|
|
$adminId = $this->adminId;
|
|
|
if (!empty($adminId)) {
|
|
|
if ($cg->mainId != $this->mainId) {
|
|
|
- util::success(['hint' => 'cg mainId != this mainId']);
|
|
|
+ util::success(['assign' => 0, 'hint' => 'cg mainId != this mainId']);
|
|
|
}
|
|
|
$shop = $this->shop;
|
|
|
$bookSn = $shop->bookSn ?? 0;
|
|
|
if ($bookSn != $cgBookSn) {
|
|
|
- util::success(['hint' => 'shop bookSn != cg bookSn']);
|
|
|
+ util::success(['assign' => 0, 'hint' => 'shop bookSn != cg bookSn']);
|
|
|
}
|
|
|
} else {
|
|
|
if ($cg->salt != $salt) {
|
|
|
- util::success(['hint' => 'cg salt != post salt']);
|
|
|
+ util::success(['assign' => 0, 'hint' => 'cg salt != post salt']);
|
|
|
}
|
|
|
$shopId = $cg->shopId ?? 0;
|
|
|
$shop = ShopClass::getById($shopId, true);
|
|
|
if (empty($shop)) {
|
|
|
- util::success(['hint' => 'shop empty']);
|
|
|
+ util::success(['assign' => 0, 'hint' => 'shop empty']);
|
|
|
}
|
|
|
if ($shop->bookSn != $cgBookSn) {
|
|
|
- util::success(['hint' => 'shop bookSn != cg bookSn o']);
|
|
|
+ util::success(['assign' => 0, 'hint' => 'shop bookSn != cg bookSn o']);
|
|
|
}
|
|
|
}
|
|
|
$connection = Yii::$app->db;
|
|
|
@@ -559,7 +559,7 @@ class PurchaseOrderController extends BaseController
|
|
|
try {
|
|
|
PurchaseOrderClass::assign($cg);
|
|
|
$transaction->commit();
|
|
|
- util::complete('货位获取成功');
|
|
|
+ util::success(['assign' => 1]);
|
|
|
} catch (\Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
util::fail('获取失败');
|