|
|
@@ -3,6 +3,7 @@
|
|
|
namespace shop\controllers;
|
|
|
|
|
|
use biz\purchase\classes\PurchaseClass;
|
|
|
+use biz\purchase\services\PurchaseService;
|
|
|
use bizGhs\product\classes\ProductClass;
|
|
|
use common\components\orderSn;
|
|
|
use Yii;
|
|
|
@@ -15,12 +16,12 @@ class PurchaseController extends BaseController
|
|
|
public function actionCreateOrder()
|
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
|
- $ghsShopId = $post['ghsShopId'] ?? 0;
|
|
|
+ $upShopId = $post['upShopId'] ?? 0;
|
|
|
$post['shopId'] = $this->shopId;
|
|
|
$product = $post['product'] ?? '';
|
|
|
$productList = json_decode($product, true);
|
|
|
//判断product数据是不是同个供货商的
|
|
|
- ProductClass::valid($productList, $ghsShopId);
|
|
|
+ ProductClass::valid($productList, $upShopId);
|
|
|
$post['product'] = $productList;
|
|
|
$respond = PurchaseClass::addPurchase($post);
|
|
|
$orderSn = $respond['orderSn'] ?? '';
|
|
|
@@ -58,4 +59,17 @@ class PurchaseController extends BaseController
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
+ //采购记录 shish 2021.1.24
|
|
|
+ public function actionList()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $where = ['merchantId' => $this->merchantId];
|
|
|
+ $status = $get['status'] ?? 0;
|
|
|
+ if (!empty($status)) {
|
|
|
+ $where['status'] = $status;
|
|
|
+ }
|
|
|
+ $list = PurchaseService::getPurchaseList($where);
|
|
|
+ util::success($list);
|
|
|
+ }
|
|
|
+
|
|
|
}
|