2024-09-29 15:43:18 +08:00

77 lines
2.1 KiB
PHP

<?php
namespace app\kami\controller\suoka;
use app\channel\service\ChannelService;
use app\channel\service\ProductService;
use app\gateway\service\AuthService;
use app\gateway\service\RedisService;
use app\merchant\service\MerchantService;
use app\merchant\service\OrderHistoryService;
use app\merchant\service\OrderService;
use dever\Log;
use think\admin\Controller;
use think\exception\HttpResponseException;
use think\facade\Http;
class Core extends Controller
{
#»ñÈ¡ÇþµÀÐÅÏ¢
public function getChanelSuoKaData($cid)
{
$ChannelService = ChannelService::instance();
$chanelInfo = $ChannelService->getInfo($cid);
// var_dump($chanelInfo);die;
if(isset($chanelInfo['other_data'])){
$suoka_data = json_decode($chanelInfo['other_data'],true);
if(isset($suoka_data['suoka_url'])){
$suoka_data['suoka_url'] = urldecode($suoka_data['suoka_url']);
}
if(isset($suoka_data['login_url'])){
$suoka_data['login_url'] = urldecode($suoka_data['login_url']);
}
if(isset($suoka_data['chaka_url'])){
$suoka_data['chaka_url'] = urldecode($suoka_data['chaka_url']);
}
if(isset($suoka_data['replace_url'])){
$suoka_data['replace_url'] = urldecode($suoka_data['replace_url']);
}
return $suoka_data;
}
return 'error';
}
public function getChanelInfo($cid)
{
$ChannelService = ChannelService::instance();
$chanelInfo = $ChannelService->get($cid);
if (!$chanelInfo) {
return 'ÇþµÀ´íÎó';
}else{
return $chanelInfo;
}
}
public function getcCookiePatch($chanel)
{
$path = root_path();
$path = $path . "extend/" . 'data/cookie' . DIRECTORY_SEPARATOR;
if ($chanel) {
$path .= $chanel . DIRECTORY_SEPARATOR;
}
return $path;
}
public function getProductInfo($pid)
{
$ChanelProductService = ProductService::instance();
return $ChanelProductService->getInfo($pid);
}
}