| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace ghs\controllers;
- use biz\product\classes\XjClass;
- use common\components\imgUtil;
- use common\components\util;
- use Yii;
- class XjController extends BaseController
- {
- //取出所有小菊 shish 20210904
- public function actionGetAllXj()
- {
- $where = [];
- $where['shopId'] = $this->shopId;
- $where['status'] = 1;
- $list = XjClass::getShopXj($this->shopId);
- util::success(['list' => $list]);
- }
- //取出商家小菊 shish 20210904
- public function actionGetSjXj()
- {
- $list = XjClass::getSjXj($this->shopExt);
- util::success(['list' => $list]);
- }
- //取出所有小菊,带商家有没有标识 shish 20210904
- public function actionGetFilterXj()
- {
- $list = XjClass::getAllByCondition(['shopId' => $this->shopId, 'delStatus' => 0], null, '*');
- if (!empty($list)) {
- foreach ($list as $key => $val) {
- $shortCover = $val['cover'] ?? '';
- $cover = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_130,w_130";
- $bigCover = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_700,w_700";
- $list[$key]['cover'] = $cover;
- $list[$key]['bigCover'] = $bigCover;
- $list[$key]['shortCover'] = $shortCover;
- }
- }
- util::success(['list' => $list]);
- }
- //清除全部小菊 lqh 2021.12.8
- public function actionClearAll()
- {
- XjClass::clearAll($this->shopId);
- //ShopExtClass::clearXjALl($this->shopId);
- util::complete('已删除');
- }
- //新增小菊 lqh 2021.12.8
- public function actionBatchAdd()
- {
- $post = Yii::$app->request->post();
- $xjData = $post['xjData'] ?? '';
- if (empty($xjData)) {
- util::fail('请上传图片');
- }
- $arr = json_decode($xjData, true);
- if (is_array($arr) == false) {
- util::fail('请上传图片...');
- }
- XjClass::batchAddXj($arr, $this->shop);
- util::complete('添加成功');
- }
- }
|