|
|
@@ -16,8 +16,8 @@ class ShopExtController extends BaseController
|
|
|
public function actionAddPrint()
|
|
|
{
|
|
|
$shopId = $this->shopId;
|
|
|
- $ext = ShopExtClass::getByCondition(['shopId' => $shopId]);
|
|
|
- if (isset($ext['printSn']) && !empty($ext['printSn'])) {
|
|
|
+ $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
+ if (isset($ext->printSn) && !empty($ext->printSn)) {
|
|
|
util::fail('您已经添加过了');
|
|
|
}
|
|
|
$get = Yii::$app->request->get();
|
|
|
@@ -26,6 +26,9 @@ class ShopExtController extends BaseController
|
|
|
$print = new printUtil($sn);
|
|
|
$shop = $this->shop;
|
|
|
$shopName = $shop['shopName'] ?? '';
|
|
|
+ $ext->printSn = $sn;
|
|
|
+ $ext->printKey = $key;
|
|
|
+ $ext->save();
|
|
|
$return = $print->addPrint($key, $shopName);
|
|
|
if ($return) {
|
|
|
util::complete();
|