|
|
@@ -1,46 +1,24 @@
|
|
|
<?php
|
|
|
+
|
|
|
namespace saas\controllers;
|
|
|
+
|
|
|
+use biz\goods\services\GoodsService;
|
|
|
+use biz\retail\services\RetailAssetService;
|
|
|
use Yii;
|
|
|
-use yii\helpers\Json;
|
|
|
-use common\services\xhGoodsSettingService;
|
|
|
-use common\components\configDict;
|
|
|
-use common\services\xhRecommendService;
|
|
|
use common\components\util;
|
|
|
-use common\components\qrCodeUtil;
|
|
|
-use common\models\xhGoods;
|
|
|
-use common\services\xhGoodsService;
|
|
|
-use common\services\xhGoodsPriceService;
|
|
|
-use common\services\xhTMessageService;
|
|
|
-use common\services\xhCategoryService;
|
|
|
-use common\components\page;
|
|
|
-use common\services\xhAdminToMerchantService;
|
|
|
-use common\services\xhWxOpenService;
|
|
|
-class GoodsController extends PlatformController
|
|
|
+
|
|
|
+
|
|
|
+class GoodsController extends BaseController
|
|
|
{
|
|
|
- /**
|
|
|
- * 商品列表
|
|
|
- */
|
|
|
- public function actionList()
|
|
|
- {
|
|
|
- $get = Yii::$app->request->get();
|
|
|
- $query = xhGoods::find();
|
|
|
- $status = isset($get['status']) ? $get['status'] : -1;
|
|
|
- if(isset($get['status']) && $get['status'] != -1){
|
|
|
- $query->andWhere(['status' => $get['status']]);
|
|
|
- }
|
|
|
- $query->andWhere(['delStatus' => 0]);
|
|
|
- if(isset($get['goodsName']) && !empty($get['goodsName'])){
|
|
|
- $query->andWhere(['like', 'goodsName', $get['goodsName']]);
|
|
|
- }
|
|
|
- $query->orderBy('id desc');
|
|
|
- $countQuery = clone $query;
|
|
|
- $count = $countQuery->count();
|
|
|
- $page = isset($get['page']) ? $get['page'] : 1;
|
|
|
- $pageSize = 20;
|
|
|
- $offset = ($page - 1) * $pageSize;
|
|
|
- $models = $query->offset($offset)->limit($pageSize)->asArray()->all();
|
|
|
- $page = new page($count,$page,$pageSize);
|
|
|
- $paging = $page->fpage();
|
|
|
- return $this->render('list', ['models' => $models,'paging' => $paging,'status' => $status,]);
|
|
|
- }
|
|
|
+
|
|
|
+ //商品列表 shish 2019.12.7
|
|
|
+ public function actionList()
|
|
|
+ {
|
|
|
+ $where = [];
|
|
|
+ $data = GoodsService::getGoodsList($where);
|
|
|
+ $asset = RetailAssetService::getAsset();
|
|
|
+ $data['RetailAsset'] = $asset;
|
|
|
+ util::success($data);
|
|
|
+ }
|
|
|
+
|
|
|
}
|