| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?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;
- $post['shopId'] = $this->shopId;
- $product = $post['product'] ?? '';
- $productList = json_decode($product, true);
- //判断product数据是不是同个供货商的
- ProductClass::valid($productList, $ghsShopId);
- $post['product'] = $productList;
- $respond = PurchaseClass::addPurchase($post);
- $orderSn = $respond['orderSn'] ?? '';
- $actPrice = $respond['actPrice'] ?? '';
- $data = [
- 'orderSn' => $orderSn,
- 'actPrice' => $actPrice,
- 'hasBalancePay' => 1,
- 'hasPayPassword' => 0,
- 'hasDebtPay' => 1,
- ];
- util::success($data);
- }
- //延期支付 shish 2021.1.24
- public function actionDebtPay()
- {
- $get = Yii::$app->request->get();
- $id = $get['id'] ?? 0;
- $info = PurchaseClass::getInfo($id);
- PurchaseClass::valid($info, $this->shopId);
- PurchaseClass::debt($info);
- util::complete();
- }
- //余额支付 shish 2021.1.24
- public function actionBalancePay()
- {
- $get = Yii::$app->request->get();
- $id = $get['id'] ?? 0;
- $password = $get['password'] ?? '';
- $info = PurchaseClass::getInfo($id);
- PurchaseClass::valid($info, $this->shopId);
- purchaseClass::balancePay($info);
- util::complete();
- }
- }
|