request->get(); $id = $get['id'] ?? 0; $shop = ShopClass::getById($id, true); if (empty($shop)) { util::fail('没有找到门店'); } if ($shop->ptStyle != 1) { util::fail('只能给零售店操作'); } $shop->onlyCg = $shop->onlyCg == 0 ? 1 : 0; $shop->save(); util::complete(); } //门店列表 ssh 20210730 public function actionList() { $where = []; $name = Yii::$app->request->get('name', ''); if (!empty($name)) { if (stringUtil::isLetter($name)) { $where['py'] = ['like', $name]; } else { $where['merchantName'] = ['like', $name]; } } $list = ShopService::getShopList($where); util::success($list); } }