| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers;
- use Yii;
- use Exception;
- use app\models\Goods;
- use app\models\GoodsCat;
- use app\modules\admin\models\SaasCategoryForm;
- use app\modules\admin\models\StoreForm;
- use yii\helpers\Json;
- class AllianceController extends BaseController
- {
-
- //获取店铺类型列表
- public function actionStoreTypeList()
- {
- $form = new SaasCategoryForm();
- return $this->asJson($form->getList(false));
- }
- //店铺列表
- public function actionStoreList(){
- $form = new StoreForm();
- return $this->asJson($form->getAllianceList());
- }
- //模糊店铺信息
- public function actionStoreListByName(){
- $form = new StoreForm();
- return $this->asJson($form->getStoreIdByStoreName());
- }
- //商品信息
- public function actionGoodsList(){
- return $this->asJson(Goods::getAllianceList(get_params()));
- }
- /**
- * 商盟检测商品列表
- */
- public function actionDiyGoodsList()
- {
- $params = get_params();
- try {
- $goods_id = Json::decode($params['goods_id']);
- } catch (\Exception $e) {
- $goods_id = explode(',', $params['goods_id']);
- }
- $query = Goods::find()->alias('g')
- ->where([
- 'g.is_delete' => 0,
- 'g.status' => 1,
- 'g.md_food_id' => 0
- ])->andWhere(['not like', 'g.name', '当面付']);
- if ($goods_id) {
- $query->andWhere(['in','g.id', $goods_id]);
- }
- $query->select(['g.goods_num', 'g.status', 'g.product_type', 'g.virtual_sales', 'g.name', 'g.id', 'g.service', 'g.attr', 'g.cover_pic', 'g.attr', 'g.use_attr', 'g.price', 'g.original_price'])->orderBy('g.created_at desc, g.updated_at desc');
- $list = pagination_make($query);
- return $this->asJson([
- 'code' => 0,
- 'msg' => 'success',
- 'data' => [
- 'data' => $list['list'],
- 'pageNo' => $list['pageNo'],
- 'totalCount' => $list['totalCount']
- ]
- ]);
- }
- }
|