| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace shop\controllers;
- use biz\purchase\classes\PurchaseClass;
- use bizGhs\product\classes\ProductClass;
- use common\components\orderSn;
- use Yii;
- use common\components\util;
- class PurchaseController extends BaseController
- {
- //生成采购单 shish 2021.1.17
- public function actionCreateOrder()
- {
- $post = Yii::$app->request->post();
- $ghsShopId = $post['ghsShopId'] ?? 0;
- $shopId = $this->shopId;
- $post['shopId'] = $shopId;
- $product = $post['product'] ?? '';
- $arr = json_decode($product, true);
- //判断product数据是不是同个供货商的
- $ids = array_column($arr, 'productId');
- ProductClass::valid($ids, $ghsShopId);
- $post['product'] = $arr;
- PurchaseClass::addPurchase($post);
- util::complete();
- }
- }
|