|
|
@@ -51,8 +51,8 @@ class PurchaseClass extends BaseClass
|
|
|
PurchaseItemClass::batchAdd($productList);
|
|
|
|
|
|
//供货商增加订单
|
|
|
- $ghsSjId = $data['ghsSjId'] ?? 0;
|
|
|
- $ghsShopId = $data['ghsShopId'] ?? 0;
|
|
|
+
|
|
|
+
|
|
|
$getType = $data['getType'];
|
|
|
$orderData = [
|
|
|
'prePrice' => 0.01,
|
|
|
@@ -63,7 +63,7 @@ class PurchaseClass extends BaseClass
|
|
|
'merchantId' => $ghsSjId,
|
|
|
'sendType'=>$getType,
|
|
|
];
|
|
|
- $shop = ShopClass::getShopInfo($ghsShopId);
|
|
|
+
|
|
|
\bizGhs\order\classes\OrderClass::addOrder($orderData, $shop, true);
|
|
|
|
|
|
return $respond;
|
|
|
@@ -82,8 +82,8 @@ class PurchaseClass extends BaseClass
|
|
|
public static function groupPurchase($list, $showButton = false, $showProduct = false)
|
|
|
{
|
|
|
|
|
|
- $supplierIds = array_unique(array_filter(array_column($list, 'supplierId')));
|
|
|
- $supplierInfo = GhsClass::getGhsByIds($supplierIds);
|
|
|
+ $ghsIds = array_unique(array_filter(array_column($list, 'ghsId')));
|
|
|
+ $supplierInfo = GhsClass::getGhsByIds($ghsIds);
|
|
|
|
|
|
$adminIds = array_unique(array_filter(array_column($list, 'adminId')));
|
|
|
$adminInfo = AdminClass::getAdminByIds($adminIds, null, 'id');
|
|
|
@@ -93,11 +93,11 @@ class PurchaseClass extends BaseClass
|
|
|
$adminId = $val['adminId'] ?? 0;
|
|
|
$list[$key]['adminName'] = $adminInfo[$adminId]['name'] ?? '';
|
|
|
|
|
|
- $supplierId = $val['supplierId'] ?? 0;
|
|
|
- $list[$key]['supplierName'] = $supplierInfo[$supplierId]['name'] ?? '';
|
|
|
- $list[$key]['supplierAvatar'] = $supplierInfo[$supplierId]['smallLogoUrl'] ?? '';
|
|
|
- $list[$key]['supplierMobile'] = $supplierInfo[$supplierId]['mobile'] ?? '';
|
|
|
- $list[$key]['supplierAddress'] = $supplierInfo[$supplierId]['address'] ?? '';
|
|
|
+ $ghsId = $val['ghsId'] ?? 0;
|
|
|
+ $list[$key]['supplierName'] = $supplierInfo[$ghsId]['name'] ?? '';
|
|
|
+ $list[$key]['supplierAvatar'] = $supplierInfo[$ghsId]['smallLogoUrl'] ?? '';
|
|
|
+ $list[$key]['supplierMobile'] = $supplierInfo[$ghsId]['mobile'] ?? '';
|
|
|
+ $list[$key]['supplierAddress'] = $supplierInfo[$ghsId]['address'] ?? '';
|
|
|
|
|
|
if ($showButton) {
|
|
|
$list[$key]['buttonList'] = [
|
|
|
@@ -150,8 +150,8 @@ class PurchaseClass extends BaseClass
|
|
|
//采购订单支付成功后回调处理流程
|
|
|
public static function complete($purchase)
|
|
|
{
|
|
|
- $supplierId = $purchase->supplierId;
|
|
|
- if (empty($supplierId)) {
|
|
|
+ $ghsId = $purchase->ghsId;
|
|
|
+ if (empty($ghsId)) {
|
|
|
|
|
|
//补充供货商关系
|
|
|
$ghsSjId = $purchase->ghsSjId;
|