|
|
@@ -1,21 +1,23 @@
|
|
|
<?php
|
|
|
-namespace ghs\controllers;
|
|
|
|
|
|
+namespace ghs\controllers;
|
|
|
|
|
|
use bizGhs\item\classes\ItemClass;
|
|
|
use bizGhs\item\services\ItemService;
|
|
|
use common\components\util;
|
|
|
use common\services\xhItemService;
|
|
|
use Yii;
|
|
|
+
|
|
|
class ItemController extends BaseController
|
|
|
{
|
|
|
|
|
|
public function actionList()
|
|
|
{
|
|
|
- //classId
|
|
|
- $classId = Yii::$app->request->get('classId',0);
|
|
|
- $where['merchantId'] = $this->sjId;
|
|
|
- $where['classId'] = $classId;
|
|
|
+ $classId = Yii::$app->request->get('classId', 0);
|
|
|
+ $where['merchantId'] = $this->sjId;
|
|
|
+ if (!empty($classId)) {
|
|
|
+ $where['classId'] = $classId;
|
|
|
+ }
|
|
|
$list = ItemClass::getGhsItemList($where);
|
|
|
util::success($list);
|
|
|
}
|
|
|
@@ -43,19 +45,19 @@ class ItemController extends BaseController
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
$id = isset($get['id']) ? $get['id'] : 0;
|
|
|
- ItemService::deleteGhsItem($id,$this->shopId,$this->sjId,$this->adminId);
|
|
|
+ ItemService::deleteGhsItem($id, $this->shopId, $this->sjId, $this->adminId);
|
|
|
util::complete('操作成功');
|
|
|
}
|
|
|
|
|
|
//获取平台里的花材信息
|
|
|
public function actionPlatformItem()
|
|
|
{
|
|
|
- $py = Yii::$app->request->get('py','');
|
|
|
+ $py = Yii::$app->request->get('py', '');
|
|
|
$where = [];
|
|
|
- if($py){
|
|
|
+ if ($py) {
|
|
|
$where = ['py' => $py];
|
|
|
}
|
|
|
- $list = xhItemService::getItemList('*',$where,'id desc');
|
|
|
+ $list = xhItemService::getItemList('*', $where, 'id desc');
|
|
|
util::success($list);
|
|
|
}
|
|
|
}
|