|
@@ -3,8 +3,9 @@
|
|
|
namespace ghs\controllers;
|
|
namespace ghs\controllers;
|
|
|
|
|
|
|
|
use biz\product\classes\XjClass;
|
|
use biz\product\classes\XjClass;
|
|
|
|
|
+use biz\shop\classes\ShopExtClass;
|
|
|
use common\components\util;
|
|
use common\components\util;
|
|
|
-
|
|
|
|
|
|
|
+use Yii;
|
|
|
class XjController extends BaseController
|
|
class XjController extends BaseController
|
|
|
{
|
|
{
|
|
|
|
|
|
|
@@ -14,7 +15,7 @@ class XjController extends BaseController
|
|
|
$where = [];
|
|
$where = [];
|
|
|
$where['shopId'] = $this->shopId;
|
|
$where['shopId'] = $this->shopId;
|
|
|
$where['status'] = 1;
|
|
$where['status'] = 1;
|
|
|
- $list = XjClass::getAllXj();
|
|
|
|
|
|
|
+ $list = XjClass::getShopXj($this->shopId);
|
|
|
util::success(['list' => $list]);
|
|
util::success(['list' => $list]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -31,7 +32,7 @@ class XjController extends BaseController
|
|
|
$where = [];
|
|
$where = [];
|
|
|
$where['shopId'] = $this->shopId;
|
|
$where['shopId'] = $this->shopId;
|
|
|
$where['status'] = 1;
|
|
$where['status'] = 1;
|
|
|
- $list = XjClass::getAllXj();
|
|
|
|
|
|
|
+ $list = XjClass::getShopXj($this->shopId);
|
|
|
$ext = $this->shopExt;
|
|
$ext = $this->shopExt;
|
|
|
$xj = $ext->xj ?? '';
|
|
$xj = $ext->xj ?? '';
|
|
|
$hasIds = [];
|
|
$hasIds = [];
|
|
@@ -50,4 +51,24 @@ class XjController extends BaseController
|
|
|
util::success(['list' => $list]);
|
|
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 actionAdd()
|
|
|
|
|
+ {
|
|
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
|
|
+ $cover = $post['cover']??'';
|
|
|
|
|
+ if(empty($cover)){
|
|
|
|
|
+ util::fail("请上传图片");
|
|
|
|
|
+ }
|
|
|
|
|
+ XjClass::addXj($this->shopId,$cover,$this->shopExt);
|
|
|
|
|
+ util::complete();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|