|
|
@@ -74,7 +74,7 @@ class PurchaseController extends BaseController
|
|
|
$get = Yii::$app->request->get();
|
|
|
$orderSn = $get['orderSn'] ?? 0;
|
|
|
$info = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
- PurchaseClass::valid($info->attributes, $this->shopId);
|
|
|
+ PurchaseService::valid($info, $this->shopId);
|
|
|
$ghsId = $info->ghsId;
|
|
|
$ghs = GhsClass::getGhsInfo($ghsId);
|
|
|
$customId = $ghs['customId'] ?? 0;
|
|
|
@@ -113,8 +113,7 @@ class PurchaseController extends BaseController
|
|
|
if (empty($info)) {
|
|
|
util::fail('没有找到采购单');
|
|
|
}
|
|
|
-
|
|
|
- PurchaseClass::valid($info->attributes, $this->shopId);
|
|
|
+ PurchaseService::valid($info, $this->shopId);
|
|
|
$connection = Yii::$app->db;//事务处理
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
@@ -148,7 +147,9 @@ class PurchaseController extends BaseController
|
|
|
$get = Yii::$app->request->get();
|
|
|
$id = $get['id'] ?? 0;
|
|
|
$info = PurchaseService::getInfo($id, true, true);
|
|
|
- PurchaseClass::valid($info, $this->shopId);
|
|
|
+ if (isset($info['shopId']) == false || $info['shopId'] != $this->shopId) {
|
|
|
+ util::fail('没有权限访问');
|
|
|
+ }
|
|
|
util::success($info);
|
|
|
}
|
|
|
|
|
|
@@ -240,9 +241,10 @@ class PurchaseController extends BaseController
|
|
|
util::success($newParams);
|
|
|
}
|
|
|
|
|
|
- //运费计算 linqh 2021.4.12 暂反回固定
|
|
|
+ //运费计算 linqh 2021.4.12 暂时返回固定值
|
|
|
public function actionFreight()
|
|
|
{
|
|
|
util::success(['sedCost' => 10]);
|
|
|
}
|
|
|
+
|
|
|
}
|