Files
OMS/app/tbo2o/lib/rpc/response/channel.php
2025-12-28 23:13:25 +08:00

51 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
//已弃用 全渠道无需iframe绑定奇门
class tbo2o_rpc_response_channel extends ome_rpc_response{
/**
* qimen_callback
* @param mixed $result result
* @return mixed 返回值
*/
public function qimen_callback($result){
$nodes = $_POST;
$status = $nodes['status'];
$node_id = $nodes['node_id'];
$node_type = $nodes['node_type'];
if($node_type != "qimen"){
//非淘宝全渠道奇门绑定
die(1);
}
$mdlTbo2oShop = app::get('tbo2o')->model('shop');
$tbo2o_shop = kernel::single('tbo2o_common')->getTbo2oShopInfo();
if(!empty($tbo2o_shop)){
$filter_arr = array("id"=>$tbo2o_shop["id"]);
}
if ($status == 'bind'){
//绑定
$sql_arr = array("qimen_node_id" => $node_id);
if($filter_arr){
//有配置信息 更新记录
$mdlTbo2oShop->update($sql_arr,$filter_arr);
}else{
//无配置信息 新建记录
$mdlTbo2oShop->insert($sql_arr);
}
}elseif ($status == 'unbind' && $tbo2o_shop["qimen_node_id"] == $node_id){
//解绑
$sql_arr = array("qimen_node_id" => "");
if($filter_arr){
//有配置信息 更新记录
$mdlTbo2oShop->update($sql_arr,$filter_arr);
}
}
die('1');
}
}