|
|
@@ -46,9 +46,9 @@ class GoodsController extends BaseController
|
|
|
$name = $info->name ?? '';
|
|
|
$goodsSn = $info->sn ?? '';
|
|
|
$price = floatval($info->price) ?? 0;
|
|
|
- if(stringUtil::getWordNum($name)>7){
|
|
|
+ if (stringUtil::getWordNum($name) > 7) {
|
|
|
$content = '<TEXT x="30" y="45" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$content = '<TEXT x="30" y="45" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
|
|
|
}
|
|
|
$content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">#' . $goodsSn . '</BC128>';
|
|
|
@@ -429,4 +429,21 @@ class GoodsController extends BaseController
|
|
|
util::fail("保存失败");
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+ //创建编号 ssh 20251110
|
|
|
+ public function actionCreateSn()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $info = GoodsClass::getById($id, true);
|
|
|
+ if (empty($info)) {
|
|
|
+ util::fail('没有找到商品');
|
|
|
+ }
|
|
|
+ if ($info->mainId != $this->mainId) {
|
|
|
+ util::fail('不是你的商品');
|
|
|
+ }
|
|
|
+ $shop = $this->shop;
|
|
|
+ GoodsClass::generateSn($info, $shop);
|
|
|
+ util::complete('创建成功');
|
|
|
+ }
|
|
|
+
|
|
|
+}
|