| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace hd\controllers;
- use biz\ghs\classes\GhsClass;
- use biz\shop\classes\ShopClass;
- use common\components\util;
- use Yii;
- class GhsController extends BaseController
- {
- public $guestAccess = ['info'];
- //供应商列表 ssh 2021.1.24
- public function actionList()
- {
- $where = [];
- $where['ownShopId'] = $this->shopId;
- $respond = GhsClass::getGhsList($where);
- util::success($respond);
- }
- //详情 shish 2021.4.11
- public function actionDetail()
- {
- $id = Yii::$app->request->get('id');
- $info = GhsClass::getGhsInfo($id);
- GhsClass::valid($info, $this->shopId);
- util::success($info);
- }
- //根据门店获取供应商信息 shish 2021.4.14
- public function actionInfo()
- {
- $shopId = Yii::$app->request->get('shopId');
- if (isset($this->shopId) && !empty($this->shopId)) {
- $ghs = GhsClass::build($shopId, $this->shopId);
- } else {
- //没有开店也给显示供应商信息
- $shop = ShopClass::getShopInfo($shopId);
- $shopName = $shop['shopName'] ?? '';
- $sjName = $shop['merchantName'] ?? '';
- $name = $sjName . ' ' . $shopName;
- $ghs = [
- 'id' => 0,
- 'name' => $name,
- 'debtAmount' => 0.00,
- 'expendAmount' => 0.00,
- ];
- }
- util::success($ghs);
- }
- }
|