|
@@ -47,7 +47,7 @@ class ProductController extends BaseController
|
|
|
|
|
|
|
|
$p->times = $num;
|
|
$p->times = $num;
|
|
|
$content = '<TEXT x="360" y="30" font="12" w="2" h="2" r="90">' . $name . '</TEXT>';
|
|
$content = '<TEXT x="360" y="30" font="12" w="2" h="2" r="90">' . $name . '</TEXT>';
|
|
|
- $content .= '<BC128 x="260" y="30" h="80" s="1" r="90" n="5" w="12">'.$ptItemId.'</BC128>';
|
|
|
|
|
|
|
+ $content .= '<BC128 x="260" y="30" h="80" s="1" r="90" n="5" w="12">' . $ptItemId . '</BC128>';
|
|
|
$p->printLabelMsg($content);
|
|
$p->printLabelMsg($content);
|
|
|
util::complete();
|
|
util::complete();
|
|
|
}
|
|
}
|
|
@@ -255,34 +255,40 @@ class ProductController extends BaseController
|
|
|
|
|
|
|
|
$productList = ProductClass::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id', true);
|
|
$productList = ProductClass::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id', true);
|
|
|
foreach ($arr as $product) {
|
|
foreach ($arr as $product) {
|
|
|
- if (isset($product['price']) == false) {
|
|
|
|
|
- util::fail('没有价格');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $productId = $product['id'];
|
|
|
|
|
+ $productInfo = $productList[$productId] ?? [];
|
|
|
|
|
+ if (empty($productInfo)) {
|
|
|
|
|
+ util::fail('没有找到花材');
|
|
|
}
|
|
}
|
|
|
|
|
+ $productName = $productInfo->name ?? '';
|
|
|
if (isset($product['id']) == false) {
|
|
if (isset($product['id']) == false) {
|
|
|
util::fail('没有花材');
|
|
util::fail('没有花材');
|
|
|
}
|
|
}
|
|
|
|
|
+ if (isset($product['price']) == false || is_numeric($product['price']) == false || $product['price'] < 0) {
|
|
|
|
|
+ util::fail('请填写' . $productName . '的花店价');
|
|
|
|
|
+ }
|
|
|
$price = $product['price'];
|
|
$price = $product['price'];
|
|
|
- $productId = $product['id'];
|
|
|
|
|
-
|
|
|
|
|
- $product = $productList[$productId] ?? [];
|
|
|
|
|
- if (empty($product)) {
|
|
|
|
|
- util::fail('没有找到花材');
|
|
|
|
|
|
|
+ if (isset($product['skPrice']) == false || is_numeric($product['skPrice']) == false || $product['skPrice'] < 0) {
|
|
|
|
|
+ util::fail('请填写' . $productName . '的散客价');
|
|
|
}
|
|
}
|
|
|
- if (isset($product->mainId) == false || $product->mainId != $this->mainId) {
|
|
|
|
|
|
|
+ $skPrice = $product['skPrice'];
|
|
|
|
|
+
|
|
|
|
|
+ if (isset($productInfo->mainId) == false || $productInfo->mainId != $this->mainId) {
|
|
|
util::fail('没有权限访问');
|
|
util::fail('没有权限访问');
|
|
|
}
|
|
}
|
|
|
if (empty($price)) {
|
|
if (empty($price)) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- $ptItemId = $product->itemId;
|
|
|
|
|
- ProductClass::changeSinglePrice($shop, $ptItemId, $price);
|
|
|
|
|
|
|
+ $ptItemId = $productInfo->itemId;
|
|
|
|
|
+ ProductClass::changeSinglePrice($shop, $ptItemId, $price, $skPrice);
|
|
|
//在首店修改需要同步到所有直营店
|
|
//在首店修改需要同步到所有直营店
|
|
|
if ($default == 1) {
|
|
if ($default == 1) {
|
|
|
foreach ($chainShopList as $chain) {
|
|
foreach ($chainShopList as $chain) {
|
|
|
if ($chain->id == $shop->id) {
|
|
if ($chain->id == $shop->id) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- ProductClass::changeSinglePrice($chain, $ptItemId, $price);
|
|
|
|
|
|
|
+ ProductClass::changeSinglePrice($chain, $ptItemId, $price, $skPrice);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|