|
|
@@ -5,6 +5,7 @@ namespace ghs\controllers;
|
|
|
use biz\product\classes\XjClass;
|
|
|
use biz\shop\classes\ShopExtClass;
|
|
|
use bizGhs\order\classes\PurchaseOrderClass;
|
|
|
+use bizGhs\product\classes\ProductClass;
|
|
|
use common\components\printUtil;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
@@ -14,6 +15,85 @@ class ShopExtController extends BaseController
|
|
|
|
|
|
public $guestAccess = [];
|
|
|
|
|
|
+ //修改拓展信息表 ssh 20251005
|
|
|
+ public function actionModifyExt()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $arr = [];
|
|
|
+ if (isset($post['orderFlow'])) {
|
|
|
+ $arr['orderFlow'] = $post['orderFlow'];
|
|
|
+ }
|
|
|
+ if (isset($post['thirdSend'])) {
|
|
|
+ $arr['thirdSend'] = $post['thirdSend'];
|
|
|
+ }
|
|
|
+ if (isset($post['thirdSendFee'])) {
|
|
|
+ $arr['thirdSendFee'] = $post['thirdSendFee'];
|
|
|
+ }
|
|
|
+ if (empty($arr)) {
|
|
|
+ util::fail('没有需要修改');
|
|
|
+ }
|
|
|
+ $shopId = $this->shopId;
|
|
|
+ \bizHd\shop\classes\ShopExtClass::updateByCondition(['shopId' => $shopId], $arr);
|
|
|
+ util::complete('修改成功');
|
|
|
+ }
|
|
|
+
|
|
|
+ //设置处理花材、扫码收款和直接收款使用的花材 ssh 20250905
|
|
|
+ public function actionSetItem()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $shopId = $this->shopId;
|
|
|
+ $shop = $this->shop;
|
|
|
+ $lsShopId = $shop->lsShopId ?? 0;
|
|
|
+ $lsExt = null;
|
|
|
+ //零售端需要同步修改
|
|
|
+ if (!empty($lsShopId)) {
|
|
|
+ $lsExt = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $lsShopId], true);
|
|
|
+ }
|
|
|
+ $ext = \bizHd\shop\classes\ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
+ $losingItem = $post['losingItem'] ?? 0;
|
|
|
+ if (!empty($losingItem)) {
|
|
|
+ $info = ProductClass::getById($losingItem, true);
|
|
|
+ if ($info->mainId != $this->mainId) {
|
|
|
+ util::fail('不是你的花材呢,编号099323');
|
|
|
+ }
|
|
|
+ $ext->losingItem = $losingItem;
|
|
|
+ $ext->save();
|
|
|
+ if (!empty($lsExt)) {
|
|
|
+ $lsExt->losingItem = $losingItem;
|
|
|
+ $lsExt->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $zjGatheringItem = $post['zjGatheringItem'] ?? 0;
|
|
|
+ if (!empty($zjGatheringItem)) {
|
|
|
+ $info = ProductClass::getById($losingItem, true);
|
|
|
+ if ($info->mainId != $this->mainId) {
|
|
|
+ util::fail('不是你的花材呢,编号099324');
|
|
|
+ }
|
|
|
+ $ext->zjGatheringItem = $zjGatheringItem;
|
|
|
+ $ext->save();
|
|
|
+ if (!empty($lsExt)) {
|
|
|
+ $lsExt->zjGatheringItem = $zjGatheringItem;
|
|
|
+ $lsExt->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ util::complete('修改成功');
|
|
|
+ }
|
|
|
+
|
|
|
+ public function actionInfo()
|
|
|
+ {
|
|
|
+ $ext = $this->shopExt;
|
|
|
+ $losingItemId = $ext->losingItem ?? 0;
|
|
|
+ $losingItem = ProductClass::getById($losingItemId, true);
|
|
|
+ $losingItemName = $losingItem->name ?? '';
|
|
|
+ $zjGatheringItemId = $ext->zjGatheringItem ?? 0;
|
|
|
+ $zjGatheringItem = ProductClass::getById($zjGatheringItemId, true);
|
|
|
+ $zjGatheringItemName = $zjGatheringItem->name ?? '';
|
|
|
+ $arr = $ext->attributes ?? [];
|
|
|
+ $arr['losingItemName'] = $losingItemName;
|
|
|
+ $arr['zjGatheringItemName'] = $zjGatheringItemName;
|
|
|
+ util::success($arr);
|
|
|
+ }
|
|
|
+
|
|
|
//添加外采打印机 ssh 20230618
|
|
|
public function actionAddWcPrint()
|
|
|
{
|
|
|
@@ -242,4 +322,4 @@ class ShopExtController extends BaseController
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+}
|