shopAdmin; if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) { util::fail('超管才能修改'); } $shopId = $this->shopId; $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true); $get = Yii::$app->request->get(); $printSn = $get['printSn'] ?? ''; $printKey = $get['printKey'] ?? ''; $printLabelSn = $get['printLabelSn'] ?? ''; $printLabelKey = $get['printLabelKey'] ?? ''; $shop = $this->shop; $default = $shop->default ?? 0; $shopName = $shop->shopName ?? ''; $sj = $this->sj; $sjName = $sj->name ?? ''; $name = $default == 1 ? $sjName : $sjName . ' ' . $shopName; if (!empty($printSn) && !empty($printKey)) { $print = new printUtil($printSn); $return = $print->addPrint($printKey, $name); if ($return) { $ext->printSn = $printSn; $ext->printKey = $printKey; $ext->save(); } } else { $ext->printSn = ''; $ext->printKey = ''; $ext->save(); } if (!empty($printLabelSn) && !empty($printLabelKey)) { $labelPrint = new printUtil($printLabelSn); $return = $labelPrint->addPrint($printLabelKey, $name); if ($return) { $ext->printLabelSn = $printLabelSn; $ext->printLabelKey = $printLabelKey; $ext->save(); //将打印纸张设置为50X70 $labelPrint->times = 1; $content = '50,70'; $labelPrint->printLabelMsg($content); } } else { $ext->printLabelSn = ''; $ext->printLabelKey = ''; $ext->save(); } util::complete(); } //获取打印机信息 public function actionGetPrint() { $shopId = $this->shopId; $ext = ShopExtClass::getByCondition(['shopId' => $shopId]); util::success($ext); } //获取云喇叭信息 ssh 20220105 public function actionGetLb() { $shopId = $this->shopId; $ext = ShopExtClass::getByCondition(['shopId' => $shopId]); util::success($ext); } //添加喇叭 ssh 20220105 public function actionAddLb() { $shopAdmin = $this->shopAdmin; if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) { util::fail('超管才能修改'); } $shopId = $this->shopId; $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true); $get = Yii::$app->request->get(); $lbSn = $get['lbSn'] ?? ''; $ext->lbSn = $lbSn; $ext->save(); util::complete('设置成功'); } //小菊启用和停用 ssh 20211210 public function actionReplaceXj() { $act = Yii::$app->request->get('act', 'start'); $id = Yii::$app->request->get('id', 0); $xj = XjClass::getById($id, true); if (empty($xj)) { util::fail('没有找到小菊'); } $status = $act == 'start' ? 1 : 2; $xj->status = $status; $xj->save(); util::complete(); } }