request->get('alone', 0); $shopId = $this->shopId; $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (empty($ext)) { util::fail('没有找到门店35'); } $ext->mtAlone = $alone; $ext->save(); util::complete(); } //取出供货商的小菊颜色 ssh 20210907 public function actionGetGhsXj() { $id = Yii::$app->request->get('ghsId', 0); $ptItemId = Yii::$app->request->get('ptItemId', 0); $ghs = GhsClass::getById($id, true); GhsClass::valid($ghs, $this->shopId); $ghsMainId = $ghs->mainId ?? 0; $itemInfo = ItemClass::getByCondition(['mainId' => $ghsMainId, 'itemId' => $ptItemId], true); if (empty($itemInfo)) { util::fail('没有花材'); } $list = XjClass::getAllByCondition(['mainId' => $ghsMainId, 'ptItemId' => $ptItemId, 'delStatus' => 0, 'status' => 1], 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, 'itemInfo' => $itemInfo]); } //添加打印机 ssh 20210712 public function actionAddPrint() { $shopAdmin = $this->shopAdmin; $roleId = $shopAdmin['roleId'] ?? 0; $role = AdminRoleClass::getById($roleId); $roleName = $role['roleName'] ?? ''; if ($roleName == '员工') { 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 && $shopName == '首店' ? $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(); } //添加打印机 ssh 20210712 public function actionAddMakePrint() { $shopAdmin = $this->shopAdmin; $roleId = $shopAdmin['roleId'] ?? 0; $role = AdminRoleClass::getById($roleId); $roleName = $role['roleName'] ?? ''; if ($roleName == '员工') { 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 && $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName; if (!empty($printSn) && !empty($printKey)) { $print = new printUtil($printSn); $return = $print->addPrint($printKey, $name); if ($return) { $ext->makePrintSn = $printSn; $ext->makePrintKey = $printKey; $ext->save(); } } else { $ext->makePrintSn = ''; $ext->makePrintKey = ''; $ext->save(); } if (!empty($printLabelSn) && !empty($printLabelKey)) { $labelPrint = new printUtil($printLabelSn); $return = $labelPrint->addPrint($printLabelKey, $name); if ($return) { $ext->makePrintLabelSn = $printLabelSn; $ext->makePrintLabelKey = $printLabelKey; $ext->save(); //将打印纸张设置为50X70 $labelPrint->times = 1; $content = '50,70'; $labelPrint->printLabelMsg($content); } } else { $ext->makePrintLabelSn = ''; $ext->makePrintLabelKey = ''; $ext->save(); } util::complete(); } //添加美团制作单用的打印机 ssh 20210712 public function actionAddMtPrint() { $shopAdmin = $this->shopAdmin; $roleId = $shopAdmin['roleId'] ?? 0; $role = AdminRoleClass::getById($roleId); $roleName = $role['roleName'] ?? ''; if ($roleName == '员工') { 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 && $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName; if (!empty($printSn) && !empty($printKey)) { $print = new printUtil($printSn); $return = $print->addPrint($printKey, $name); if ($return) { $ext->mtPrintSn = $printSn; $ext->mtPrintKey = $printKey; $ext->save(); } } else { $ext->makePrintSn = ''; $ext->makePrintKey = ''; $ext->save(); } if (!empty($printLabelSn) && !empty($printLabelKey)) { $labelPrint = new printUtil($printLabelSn); $return = $labelPrint->addPrint($printLabelKey, $name); if ($return) { $ext->mtPrintLabelSn = $printLabelSn; $ext->mtPrintLabelKey = $printLabelKey; $ext->save(); //将打印纸张设置为50X70 $labelPrint->times = 1; $content = '50,70'; $labelPrint->printLabelMsg($content); } } else { $ext->mtPrintLabelSn = ''; $ext->mtPrintLabelKey = ''; $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(); if (isset($get['lbSn'])) { $lbSn = $get['lbSn'] ?? ''; $lbVersion = $get['lbVersion'] ?? ''; $ext->lbSn = $lbSn; $ext->lbVersion = $lbVersion; $ext->save(); } if (isset($get['makeLbSn'])) { $makeLbSn = $get['makeLbSn'] ?? ''; $makeLbVersion = $get['makeLbVersion'] ?? ''; $ext->makeLbSn = $makeLbSn; $ext->makeLbVersion = $makeLbVersion; $ext->save(); } if (isset($get['mtLbSn'])) { $mtLbSn = $get['mtLbSn'] ?? ''; $mtLbVersion = $get['mtLbVersion'] ?? ''; $ext->mtLbSn = $mtLbSn; $ext->mtLbVersion = $mtLbVersion; $ext->save(); } util::complete('设置成功'); } }