From 57171b2f5772155b70ab594d537d70f90bce44da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=90?= Date: Mon, 17 Mar 2025 03:38:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(merchant):=20=E6=B7=BB=E5=8A=A0=E7=A0=81?= =?UTF-8?q?=E9=80=9F=E8=BE=BE=E8=87=AA=E5=8A=A8=E5=8F=91=E5=8D=A1=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增码速达自动发卡设置界面 - 实现码速达账号UID和密钥的保存和使用 - 添加消息订阅功能 - 优化自动发卡逻辑,增加错误处理和状态更新 --- app/channel/controller/ChannelProduct.php | 2 - app/kami/controller/suoka/JunKa.php | 1 - app/merchant/controller/Account.php | 2 - app/merchant/controller/Merchant.php | 29 +++++- app/merchant/controller/Percent.php | 4 +- app/merchant/service/MerchantLogService.php | 1 - app/merchant/service/OrderService.php | 3 - app/merchant/view/merchant/autoCard.html | 92 ++++++++++++++++++- app/openapi/controller/Taobao.php | 6 +- .../controller/robotApi/WeChatBot.php | 1 + .../kami91order/KamiOrderChanelNotify.php | 89 ++++++++++++++++-- .../KamiOrderStatusForceUpdate.php | 7 ++ 12 files changed, 206 insertions(+), 31 deletions(-) diff --git a/app/channel/controller/ChannelProduct.php b/app/channel/controller/ChannelProduct.php index a896e59..b1af1dd 100644 --- a/app/channel/controller/ChannelProduct.php +++ b/app/channel/controller/ChannelProduct.php @@ -348,8 +348,6 @@ class ChannelProduct extends Controller $gid_rule = json_encode($gid_rule); } - - $order_limit_rule = array(); foreach ($this->cash as $k => $v) { $input = input('cash_order_limit_' . $k); diff --git a/app/kami/controller/suoka/JunKa.php b/app/kami/controller/suoka/JunKa.php index 69372ad..3e7449d 100644 --- a/app/kami/controller/suoka/JunKa.php +++ b/app/kami/controller/suoka/JunKa.php @@ -43,7 +43,6 @@ class JunKa extends Core $suokaRequest = $this->getChanelSuoKaData($cid); - $url = $suokaRequest['suoka_url']; $request=$param; $request['agent_id']=$ChanelInfo['mid']; diff --git a/app/merchant/controller/Account.php b/app/merchant/controller/Account.php index 4646566..0f45d82 100644 --- a/app/merchant/controller/Account.php +++ b/app/merchant/controller/Account.php @@ -102,8 +102,6 @@ class Account extends Controller $data[$k]['account_name'] = '余额账户'; } - - if ($data[$k]['num'] > 0) { if ($v['oper'] == 1) { $data[$k]['snum'] = '+' . $data[$k]['num']; diff --git a/app/merchant/controller/Merchant.php b/app/merchant/controller/Merchant.php index a1a5f39..8291835 100644 --- a/app/merchant/controller/Merchant.php +++ b/app/merchant/controller/Merchant.php @@ -375,8 +375,6 @@ class Merchant extends Controller } } - - /** * 商户信息查看 * @login true @@ -487,6 +485,8 @@ class Merchant extends Controller $other_param_arr = json_decode($other_param,true); if(is_array($other_param_arr) && isset($other_param_arr['autoCardSoftware'])){ $this->autoCardSoftware = $other_param_arr['autoCardSoftware']; + $this->maSuDa_uid = $other_param_arr['maSuDa_uid']??null; + $this->maSuDa_secret_key = $other_param_arr['maSuDa_secret_key']??null; } } @@ -499,6 +499,21 @@ class Merchant extends Controller $other_param_arr_new = [ 'autoCardSoftware'=>$autoCardSoftware ]; + if($autoCardSoftware == 2){ + + if(!empty(input('maSuDa_uid'))){ + $other_param_arr_new['maSuDa_uid'] = input('maSuDa_uid'); + } + if(!empty(input('maSuDa_secret_key'))){ + $other_param_arr_new['maSuDa_secret_key'] = input('maSuDa_secret_key'); + } + + #消息订阅关闭 + if(!empty(input('maSuDa_message_config')) ){ + $maSuDa_message_config = input('maSuDa_message_config'); + } + + } // var_dump($other_params);die; @@ -506,10 +521,16 @@ class Merchant extends Controller if($other_param && is_string($other_param)){ $other_param_arr = json_decode($other_param,true); if(is_array($other_param_arr)){ - $other_param_arr_new = $other_param_arr; - $other_param_arr_new['autoCardSoftware'] = $autoCardSoftware; + #合并数组 + $other_param_arr_news = array_merge($other_param_arr,$other_param_arr_new); + $other_param_arr_new = $other_param_arr_news; +// $other_param_arr_new['autoCardSoftware'] = $autoCardSoftware; } } + if (isset($maSuDa_message_config) && isset($other_param_arr_new['maSuDa_message_config'])){ + #判断是否变化,进行消息修改 TODO + + } $other_json = json_encode($other_param_arr_new); diff --git a/app/merchant/controller/Percent.php b/app/merchant/controller/Percent.php index 9eb5044..e3507b3 100644 --- a/app/merchant/controller/Percent.php +++ b/app/merchant/controller/Percent.php @@ -229,9 +229,7 @@ class Percent extends Controller $update['rule'] = $rule; } $this->app->db->name('merchant_percent')->where(['id' => $info['id']])->update($update); - - } - + } //PercentService::instance()->get($mid, $product_key, false); diff --git a/app/merchant/service/MerchantLogService.php b/app/merchant/service/MerchantLogService.php index 1ff14d9..b52bf6d 100644 --- a/app/merchant/service/MerchantLogService.php +++ b/app/merchant/service/MerchantLogService.php @@ -64,7 +64,6 @@ class MerchantLogService extends Service { $data = [ 'mid' => $mid, 'num' => $num, 'account_type' => $account_type, 'type' => $type, 'desc' => $desc ]; - if ($type == 2 || $type == 3) { $data['oper'] = 2; } else { diff --git a/app/merchant/service/OrderService.php b/app/merchant/service/OrderService.php index 5b00dc7..0e3232f 100644 --- a/app/merchant/service/OrderService.php +++ b/app/merchant/service/OrderService.php @@ -107,7 +107,6 @@ class OrderService extends Service } } - if (!$info) { $data['error_account_oper'] = 1; $data['id'] = $this->db()->insertGetId($data); @@ -173,8 +172,6 @@ class OrderService extends Service if ($info['cid'] == $cid && ($info['status'] == 2 || $info['status'] == 3 || $info['status'] == 5)) { return false; } - - $where['id'] = $data['id'] = $info['id']; $update['pid'] = $pid; $update['product_key'] = $product_key; diff --git a/app/merchant/view/merchant/autoCard.html b/app/merchant/view/merchant/autoCard.html index c226337..903a53f 100644 --- a/app/merchant/view/merchant/autoCard.html +++ b/app/merchant/view/merchant/autoCard.html @@ -5,7 +5,7 @@