diff --git a/10.2.2/app/common/logic/ResModuleLogic.php b/10.2.2/app/common/logic/ResModuleLogic.php deleted file mode 100644 index 554da021..00000000 --- a/10.2.2/app/common/logic/ResModuleLogic.php +++ /dev/null @@ -1,1081 +0,0 @@ -upstreamProduct = $upstreamProduct; - } - - /** - * 时间 2022-05-27 - * @title 获取模块列表 - * @desc 获取模块列表 - * @author hh - * @version v1 - * @return string [].name - 模块名称 - * @return string [].display_name - 模块显示名称 - */ - public function getModuleList(): array - { - $modules = []; - if(is_dir($this->path)){ - if($handle = opendir($this->path)){ - while(($file = readdir($handle)) !== false){ - if($file != '.' && $file != '..' && is_dir($this->path . $file) && preg_match('/^[a-z][a-z0-9_]{0,99}$/', $file)){ - if($ImportModule = $this->importModule($file)){ - if(method_exists($ImportModule, 'metaData')){ - $metaData = call_user_func([$ImportModule, 'metaData']); - $modules[] = [ - 'name'=>$file, - 'display_name'=>$metaData['display_name'] ?: $file, - ]; - }else{ - $modules[] = [ - 'name'=>$file, - 'display_name'=>$file, - ]; - } - } - } - } - closedir($handle); - } - } - return $modules; - } - - /** - * 时间 2022-05-27 - * @title 测试连接 - * @desc 测试连接 - * @author hh - * @version v1 - * @param ServerModel ServerModel - 接口模型 - * @return int status - 200=连接成功,400=连接失败 - * @return string msg - 信息 - */ - // public function testConnect(ServerModel $ServerModel): array - // { - // $module = $ServerModel['module']; - // if($ImportModule = $this->importModule($module)){ - // if(method_exists($ImportModule, 'testConnect')){ - // // 获取模块通用参数 - // $res = call_user_func([$ImportModule, 'testConnect'], ['server'=>$ServerModel]); - // $res = $this->formatResult($res, lang('module_test_connect_success'), lang('module_test_connect_fail')); - // }else{ - // $res['status'] = 400; - // $res['msg'] = lang('undefined_test_connect_function'); - // } - // }else{ - // $res['status'] = 400; - // $res['msg'] = lang('module_file_is_not_exist'); - // } - // return $res; - // } - - /** - * 时间 2022-05-16 - * @title 产品开通 - * @desc 产品开通 - * @author hh - * @version v1 - * @param HostModel $HostModel - 产品模型 - * @return array - * @return int status - 状态,200=成功,400=失败 - * @return string msg - 信息 - */ - public function createAccount(HostModel $HostModel): array - { - $id = $HostModel->id; - - $UpstreamHostModel = new UpstreamHostModel(); - $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); - if (empty($upstreamHost)) { - return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; - } - $apiId = $this->upstreamProduct['supplier_id']; - # 检查是否可以登录 - $res = idcsmart_api_login($apiId,true); - if ($res['status']==200){ - $upstreamInfo = json_decode($upstreamHost['upstream_info'],true)??[]; - if (!empty($upstreamInfo['token'])){ - $token = $upstreamInfo['token']; - $url = $upstreamInfo['url']; - }else{ - $token = md5(rand_str(16).time().$id); - $url = configuration('website_url'); //request()->domain() . request()->rootUrl(); 服务器定时任务走cli模式,获取的是本地localhost - $upstreamHost->save([ - 'upstream_info' => json_encode(['token'=>$token,'url'=>$url]) - ]); - } - - $clearCartData = [ - 'downstream_url' => $url, - 'downstream_token' => $token, - 'downstream_host_id' => $id, - 'downstream_client_id' => $HostModel['client_id'], - ]; - - $enable = PluginModel::where('name', 'IdcsmartSubAccount')->where('module', 'addon')->where('status',1)->find(); - if(!empty($enable) && class_exists('addon\idcsmart_sub_account\model\IdcsmartSubAccountHostModel')){ - // 是否是子账户 - $IdcsmartSubAccountHostModel = IdcsmartSubAccountHostModel::where('host_id', $id)->find(); - if(!empty($IdcsmartSubAccountHostModel)){ - $IdcsmartSubAccountModel = IdcsmartSubAccountModel::find($IdcsmartSubAccountHostModel['addon_idcsmart_sub_account_id']); - if(!empty($IdcsmartSubAccountModel)){ - $clearCartData['downstream_client_id'] = $IdcsmartSubAccountModel['client_id']; - } - } - } - # 清空购物车(检查是否已下单) - $res = idcsmart_api_curl($apiId,'/console/v1/cart',$clearCartData,30,'DELETE'); - if ($res['status']==200){ - if (isset($res['data']['order_id']) && $res['data']['order_id']){ # 已在上游下单,但未支付 - /*$creditData = [ - 'id' => $res['data']['order_id']??0, - 'use' => 1 - ];*/ - # 使用余额 - //$res = idcsmart_api_curl($apiId,'/console/v1/credit',$creditData,30,'POST'); - //if ($res['status']==200){ - $payData = [ - 'id' => $res['data']['order_id']??0, - 'gateway' => 'credit' - ]; - # 支付 - $res = idcsmart_api_curl($apiId,'/console/v1/pay',$payData,30,'POST'); - //} - }else{ - $cartData = [ - 'product_id' => $this->upstreamProduct['upstream_product_id'], - 'qty' => 1, - 'config_options' => json_decode($upstreamHost['upstream_configoption'],true) - ]; - # 加入购物车 - $res = idcsmart_api_curl($apiId,'/console/v1/cart',$cartData,30,'POST'); - if ($res['status']==200){ - $settleCartData = $clearCartData; - $settleCartData['positions'] = [0]; # 取第一个,只有一个 - $settleCartData['downstream_client_id'] = $clearCartData['downstream_client_id']; - # 结算 - $res = idcsmart_api_curl($apiId,'/console/v1/cart/settle',$settleCartData,30,'POST'); - if ($res['status']==200){ - $upstreamHost->save([ - 'upstream_host_id' => $res['data']['host_ids'][0]??0, - ]); - if ($res['data']['amount']>0){ // 处理需要支付的 - /*$creditData = [ - 'id' => $res['data']['order_id']??0, - 'use' => 1 - ];*/ - # 使用余额 - //$res = idcsmart_api_curl($apiId,'/console/v1/credit',$creditData,30,'POST'); - //if ($res['status']==200){ - $payData = [ - 'id' => $res['data']['order_id']??'', - 'gateway' => 'credit' - ]; - # 支付 - $res = idcsmart_api_curl($apiId,'/console/v1/pay',$payData,30,'POST'); - //} - } - } - } - } - } - } - - return $res; - } - - /** - * 时间 2022-05-16 - * @title 产品暂停 - * @desc 产品暂停 - * @author hh - * @version v1 - * @param HostModel $HostModel - 产品模型 - * @return array - * @return int status - 状态,200=成功,400=失败 - * @return string msg - 信息 - */ - public function suspendAccount(HostModel $HostModel, $param = []): array - { - $id = $HostModel->id; - - $UpstreamHostModel = new UpstreamHostModel(); - $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); - if (empty($upstreamHost)) { - return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; - } - - $apiId = $this->upstreamProduct['supplier_id']; - - $suspendData = [ - 'suspend_type' => $param['suspend_type']??'downstream', - 'suspend_reason' => $param['suspend_reason']??'代理商暂停' - ]; - - $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/module/suspend",$suspendData,30,'POST'); - - return $res; - } - - /** - * 时间 2022-05-16 - * @title 产品解除暂停 - * @desc 产品解除暂停 - * @author hh - * @version v1 - * @param HostModel $HostModel - 产品模型 - * @return array - * @return int status - 状态,200=成功,400=失败 - * @return string msg - 信息 - */ - public function unsuspendAccount(HostModel $HostModel): array - { - $id = $HostModel->id; - - $UpstreamHostModel = new UpstreamHostModel(); - $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); - if (empty($upstreamHost)) { - return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; - } - - $apiId = $this->upstreamProduct['supplier_id']; - - $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/module/unsuspend",[],30,'POST'); - - return $res; - } - - /** - * 时间 2022-05-16 - * @title 产品删除 - * @desc 产品删除 - * @author hh - * @version v1 - * @param HostModel $HostModel - 产品模型 - * @return array - * @return int status - 状态,200=成功,400=失败 - * @return string msg - 信息 - */ - public function terminateAccount(HostModel $HostModel): array - { - $id = $HostModel->id; - - $UpstreamHostModel = new UpstreamHostModel(); - $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); - if (empty($upstreamHost)) { - return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; - } - - $apiId = $this->upstreamProduct['supplier_id']; - - // TODO - $terminateData = [ - 'host_id' => $upstreamHost['upstream_host_id'], - 'suspend_reason' => '代理商删除', - 'type' => 'Immediate' - ]; - - $res = idcsmart_api_curl($apiId,"/console/v1/refund",$terminateData,30,'POST'); - - return $res; - } - - /** - * 时间 2022-05-16 - * @title 续费订单支付后调用 - * @desc 续费订单支付后调用 - * @author hh - * @version v1 - * @param HostModel $HostModel - 产品模型 - */ - public function renew(HostModel $HostModel) - { - $id = $HostModel['id']; - - $UpstreamHostModel = new UpstreamHostModel(); - $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); - if (empty($upstreamHost)) { - return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; - } - - $apiId = $this->upstreamProduct['supplier_id']; - - $renewData = [ - 'billing_cycle' => $HostModel['billing_cycle_name']??'' - ]; - - $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/renew",$renewData,30,'POST'); - if ($res['status']==200){ - if ($res['code']=='Unpaid'){ # 未支付 - $creditData = [ - 'id' => $res['data']['id']??0, - 'use' => 1 - ]; - # 使用余额 - $res = idcsmart_api_curl($apiId,'/console/v1/credit',$creditData,30,'POST'); - if ($res['status']==200){ - $payData = [ - 'id' => $res['data']['id'], - 'gateway' => 'credit' - ]; - # 支付 - $res = idcsmart_api_curl($apiId,'/console/v1/pay',$payData,30,'POST'); - } - } - unset($res['code']); - } - - return $res; - } - - /** - * 时间 2022-05-26 - * @title 升降级配置项完成后调用 - * @desc 升降级配置项完成后调用 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @param mixed params - 自定义参数 - */ - public function changePackage(HostModel $HostModel, $params) - { - if($ImportModule = $this->importModule()){ - if(method_exists($ImportModule, 'changePackage')){ - // 获取模块通用参数 - $moduleParams = $HostModel->getModuleParams(); - $moduleParams['custom'] = $params; - $res = call_user_func([$ImportModule, 'changePackage'], $moduleParams); - } - } - // 不需要返回 - } - - /** - * 时间 2022-06-01 - * @title 升降级商品完成后调用 - * @desc 升降级商品完成后调用 - * @author hh - * @version v1 - * @param HostModel HostModel - 已经关联新商品的产品模型 - * @param mixed params - 自定义参数 - */ - // public function changeProduct(HostModel $HostModel, $params) - // { - // if($ImportModule = $this->importModule()){ - // if(method_exists($ImportModule, 'changeProduct')){ - // // 获取模块通用参数 - // $moduleParams = $HostModel->getModuleParams(); - // $moduleParams['custom'] = $params; - // $res = call_user_func([$ImportModule, 'changeProduct'], $moduleParams); - // } - // } - // // 不需要返回 - // } - - /** - * 时间 2022-05-26 - * @title 购物车价格计算 - * @desc 购物车价格计算 - * @author hh - * @version v1 - * @param ProductModel $ProductModel - 产品模型 - * @param mixed $params [] 自己定义的参数 - * @param string scene - 场景(buy=验证所有参数,cal_price=价格计算) - * @return int status - 状态(200=成功,400=失败) - * @return array data - 购物车数据 - * @return float data.price - 配置项金额 - * @return string data.billing_cycle - 周期名称 - * @return int data.duration - 周期时长 - * @return string data.description - 订单子项描述 - * @return string data.content - 购物车配置显示,支持模板 - * @return string data.preview[].name - 名称 - * @return string data.preview[].value - 值 - * @return string data.preview[].price - 价格 - */ - public function cartCalculatePrice($ProductModel, $params = [], $qty=1) - { - $apiId = $this->upstreamProduct['supplier_id']; - - $upstreamProductId = $this->upstreamProduct['upstream_product_id']; - - $res = idcsmart_api_curl($apiId,"/console/v1/product/{$upstreamProductId}/config_option", ['config_options'=>$params],30,'POST'); - if ($res['status']==200){ - $res['data']['profit'] = bcmul($res['data']['price'] ?? 0, ($this->upstreamProduct['profit_percent']/100), 2); - $res['data']['price'] = bcadd($res['data']['price'] ?? 0, $res['data']['profit'], 2); - $res['data']['renew_price'] = bcmul($res['data']['renew_price']??0,(1+$this->upstreamProduct['profit_percent']/100),2); - $res['data']['base_price'] = bcmul($res['data']['base_price']??0,(1+$this->upstreamProduct['profit_percent']/100),2); - - $description = ''; - foreach($res['data']['preview'] as $k=>$v){ - if($v['price']>0){ - $v['price'] = bcmul($v['price'],(1+$this->upstreamProduct['profit_percent']/100),2); - $res['data']['preview'][$k]['price'] = $v['price']; - } - $description .= $v['name'].': '.$v['value'].',价格:'.$v['price']."\r\n"; - } - $res['data']['description'] = $description; - $res['data']['content'] = $description; - } - return $res; - } - - /** - * 时间 2022-05-16 - * @title 后台商品接口配置输出 - * @desc 后台商品接口配置输出 - * @author hh - * @version v1 - * @param HostModel $HostModel - 产品模型 - * @return string - */ - /*public function serverConfigOption($module, ProductModel $ProductModel) - { - $res = ''; - // 模块调用 - // if($ImportModule = $this->importModule()){ - // if(method_exists($ImportModule, 'serverConfigOption')){ - // // 获取模块通用参数 - // $res = call_user_func([$ImportModule, 'serverConfigOption'], ['product'=>$ProductModel]); - // $res = $this->formatTemplate($res); - // } - // } - return $res; - }*/ - - /** - * 时间 2022-05-16 - * @title 产品列表页内容 - * @desc 产品列表页内容 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @return string - */ - public function hostList($module, $params): string - { - $res = ''; - // 模块调用 - if($ImportModule = $this->importModule($module)){ - if(method_exists($ImportModule, 'hostList')){ - // 获取模块通用参数 - $this->upstreamProduct['res_module'] = $module; - $res = call_user_func([$ImportModule, 'hostList'], $params); - $res = $this->formatTemplate($res); - } - } - return $res; - } - - /** - * 时间 2022-05-16 - * @title 产品前台内页输出 - * @desc 产品前台内页输出 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @return string - */ - public function clientArea(HostModel $HostModel): string - { - $res = ''; - // 模块调用 - // $module = $HostModel->getModule(); - if($ImportModule = $this->importModule()){ - if(method_exists($ImportModule, 'clientArea')){ - // 获取模块通用参数 - $params = $HostModel->getModuleParams(); - $res = call_user_func([$ImportModule, 'clientArea'], $params); - $res = $this->formatTemplate($res); - } - } - return $res; - // $id = $HostModel['id']; - - // $UpstreamHostModel = new UpstreamHostModel(); - // $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); - // if (empty($upstreamHost)) { - // return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; - // } - - // $apiId = $this->upstreamProduct['supplier_id']; - - // $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/view",[],30,'GET'); - - // return $res; - } - - /** - * 时间 2022-05-16 - * @title 产品后台内页输出 - * @desc 产品后台内页输出 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @return string - */ - public function adminArea(HostModel $HostModel): string - { - // $id = $HostModel['id']; - - // $UpstreamHostModel = new UpstreamHostModel(); - // $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); - // if (empty($upstreamHost)) { - // return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; - // } - - // $apiId = $this->upstreamProduct['supplier_id']; - - // $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/view",[],30,'GET'); - $res = ''; - return $res; - } - - /** - * 时间 2022-05-30 - * @title 前台商品配置页面 - * @desc 前台商品配置输出,购物车,单独订购,升降级商品 - * @author hh - * @version v1 - * @param ProductModel ProductModel - 产品模型 - * @return string - */ - public function clientProductConfigOption(ProductModel $ProductModel, $tag = ''): string - { - $res = ''; - if($ImportModule = $this->importModule()){ - if(method_exists($ImportModule, 'clientProductConfigOption')){ - // 获取模块通用参数 - $res = call_user_func([$ImportModule, 'clientProductConfigOption'], ['product'=>$ProductModel, 'tag'=>$tag]); - $res = $this->formatTemplate($res); - } - } - return $res; - // $apiId = $this->upstreamProduct['supplier_id']; - - // $upstreamProductId = $this->upstreamProduct['upstream_product_id']; - - // $res = idcsmart_api_curl($apiId,"/console/v1/product/{$upstreamProductId}/config_option",['tag'=>$tag],30,'GET'); - // if ($res['status']==200){ - // return $res['data']['content']??''; - // } - - // return ''; - } - - /** - * 时间 2022-05-31 - * @title 后台商品配置页面 - * @desc 后台商品配置输出,新建订单,升降级商品 - * @author hh - * @version v1 - * @param ProductModel ProductModel - 产品模型 - * @return string - */ - /*public function adminProductConfigOption(ProductModel $ProductModel, $tag = ''): string - { - $apiId = $this->upstreamProduct['supplier_id']; - - $upstreamProductId = $this->upstreamProduct['upstream_product_id']; - - $res = idcsmart_api_curl($apiId,"/console/v1/product/{$upstreamProductId}/config_option",['tag'=>$tag],30,'GET'); - - return $res; - }*/ - - /** - * 时间 2022-05-31 - * @title 前台产品升降级配置输出 - * @desc 前台产品升降级配置输出 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @return string - */ - /*public function clientChangeConfigOption(HostModel $HostModel): string - { - $res = ''; - if($ImportModule = $this->importModule()){ - if(method_exists($ImportModule, 'clientChangeConfigOption')){ - // 获取模块通用参数 - $params = $HostModel->getModuleParams(); - $res = call_user_func([$ImportModule, 'clientChangeConfigOption'], $params); - $res = $this->formatTemplate($res); - } - } - return $res; - }*/ - - /** - * 时间 2022-05-31 - * @title 后台产品升降级配置输出(暂时未用) - * @desc 后台产品升降级配置输出 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @return string - */ - // public function adminChangeConfigOption(HostModel $HostModel): string - // { - // $res = ''; - // if($ImportModule = $this->importModule()){ - // if(method_exists($ImportModule, 'adminChangeConfigOption')){ - // // 获取模块通用参数 - // $params = $HostModel->getModuleParams(); - // $res = call_user_func([$ImportModule, 'adminChangeConfigOption'], $params); - // $res = $this->formatTemplate($res); - // } - // } - // return $res; - // } - - /** - * 时间 2022-05-31 - * @title 升降级配置项计算价格(暂时未用) - * @desc 升降级配置项计算价格 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @param array params - 产品模型 - * @return array - */ - // public function changeConfigOptionCalculatePrice(HostModel $HostModel, $params): array - // { - // $result = []; - // if($ImportModule = $this->importModule()){ - // if(method_exists($ImportModule, 'changeConfigOptionCalculatePrice')){ - // // 获取模块通用参数 - // $result = call_user_func([$ImportModule, 'changeConfigOptionCalculatePrice'], ['host'=>$HostModel, 'product'=>ProductModel::find($HostModel['product_id']), 'custom'=>$params]); - // // TODO 是否判断返回/格式化 - - // } - // } - // if(empty($result)){ - // $result = [ - // 'status'=>400, - // 'msg'=>lang('module_file_is_not_exist'), - // ]; - // } - // return $result; - // } - - /** - * 时间 2022-05-30 - * @title 在结算之后调用 - * @desc 在结算之后调用,通常是验证参数,并保存参数 - * @author hh - * @version v1 - * @param ProductModel ProductModel - 商品模型 - * @param int hostId - 产品ID - * @param array params - 自定义参数 - */ - public function afterSettle($ProductModel, $hostId, $params): void - { - if($ImportModule = $this->importModule()){ - if(method_exists($ImportModule, 'afterSettle')){ - call_user_func([$ImportModule, 'afterSettle'], ['product'=>$ProductModel, 'host_id'=>$hostId, 'custom'=>$params]); - } - } - } - - /** - * 时间 2022-05-16 - * @title 自定义后台方法 - * @desc 自定义后台方法 - * @author hh - * @version v1 - * @param string module - 模块名称 - * @return mixed params - 自定义参数 - */ - // public function customAdminFunction($module, $params) - // { - // $res = []; - // // 验证模块格式是否正确 - // if(!$this->checkModule($module)){ - // $res['status'] = 400; - // $res['msg'] = '模块格式错误'; - // return json($res); - // } - // $controller = $params['controller'] ?? ''; - // $method = $params['method'] ?? ''; - // if(empty($controller) || empty($method)){ - // $res['status'] = 400; - // $res['msg'] = '模块格式错误'; - // return json($res); - // } - // $controller = parse_name($controller.'_controller', 1); - // $method = parse_name($method, 1, false); - - // $class = '\reserver\\'.$module.'\\controller\\admin\\'.$controller; - // if(class_exists($class)){ - // $class = new $class(); - - // if(method_exists($class, $method)){ - // $res = call_user_func([$class, $method], $params); - // }else{ - // $res['status'] = 400; - // $res['msg'] = '模块或方法不存在'; - // $res = json($res); - // } - // }else{ - // $res['status'] = 400; - // $res['msg'] = '模块或方法不存在'; - // $res = json($res); - // } - // // if($this->importModule($module)){ - // // // 执行模块操作 - // // $func = $module . '_CustomAdminFunction'; - // // if(function_exists($func)){ - // // $res = call_user_func($func, $params); - // // $res = $this->formatResult($res); - // // } - // // } - // // if(empty($res)){ - // // $res['status'] = 400; - // // $res['msg'] = '模块或方法不存在'; - // // } - // return $res; - // } - - /** - * 时间 2022-06-08 - * @title 自定义前台方法 - * @desc 自定义前台方法 - * @author hh - * @version v1 - * @param string $module - 模块名称 - * @param mixed $params - POST的其他参数 - * @return array - */ - // public function customClientFunction($module, $params) - // { - // $res = []; - // // 验证模块格式是否正确 - // if(!$this->checkModule($module)){ - // $res['status'] = 400; - // $res['msg'] = '模块格式错误'; - // return json($res); - // } - // $controller = $params['controller'] ?? ''; - // $method = $params['method'] ?? ''; - // if(empty($controller) || empty($method)){ - // $res['status'] = 400; - // $res['msg'] = '模块格式错误'; - // return json($res); - // } - // $controller = parse_name($controller.'_controller', 1); - // $method = parse_name($method, 1, false); - - // $class = '\reserver\\'.$module.'\\controller\\home\\'.$controller; - // if(class_exists($class)){ - // $class = new $class(); - - // if(method_exists($class, $method)){ - // $res = call_user_func([$class, $method], $params); - // }else{ - // $res['status'] = 400; - // $res['msg'] = '模块或方法不存在'; - // $res = json($res); - // } - // }else{ - // $res['status'] = 400; - // $res['msg'] = '模块或方法不存在'; - // $res = json($res); - // } - // return $res; - // } - - /** - * 时间 2022-06-02 - * @title 获取当前产品所有周期价格 - * @desc 获取当前产品所有周期价格 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @return int status - 状态码(200=成功,400=失败) - * @return string msg - 提示信息 - * @return array data - 数据 - * @return float data[].price - 金额 - * @return string data[].billing_cycle - 周期名称 - * @return int data[].duration - 周期时长(秒) - */ - public function durationPrice(HostModel $HostModel) - { - $id = $HostModel['id']; - - $UpstreamHostModel = new UpstreamHostModel(); - $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); - if (empty($upstreamHost)) { - return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; - } - - $apiId = $this->upstreamProduct['supplier_id']; - - $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/renew",[],30,'GET'); - - if ($res['status']==200){ - $result = [ - 'status' => 200, - 'msg' => $res['msg'], - 'data' => [ - ] - ]; - foreach ($res['data']['host'] as $item){ - $item['profit'] = bcmul($item['price'], ($this->upstreamProduct['profit_percent']/100), 2); - $item['price'] = bcadd($item['price'], $item['profit'], 2); - $result['data'][] = $item; - } - return $result; - } - - return $res; - } - - /** - * 时间 2022-06-16 - * @title 获取商品所有配置项 - * @desc 获取商品所有配置项 - * @author hh - * @version v1 - * @param ProductModel ProductModel - 商品模型 - * @return array - */ - /*public function allConfigOption(ProductModel $ProductModel) - { - $apiId = $this->upstreamProduct['supplier_id']; - - $upstreamProductId = $this->upstreamProduct['upstream_product_id']; - - $res = idcsmart_api_curl($apiId,"/api/v1/product/{$upstreamProductId}/all_config_option",[],30,'GET'); - - return $res; - }*/ - - /** - * 时间 2022-08-04 - * @title 获取当前产品配置项 - * @desc 获取当前产品配置项 - * @author hh - * @version v1 - * @param HostModel HostModel - 产品模型 - * @return int status - 状态码(200=成功,400=失败) - * @return string msg - 提示信息 - * @return array data - 数据 - */ - /*public function currentConfigOption(HostModel $HostModel) - { - $res = []; - if($ImportModule = $this->importModule()){ - if(method_exists($ImportModule, 'currentConfigOption')){ - // 获取模块通用参数 - $moduleParams = $HostModel->getModuleParams(); - $res = call_user_func([$ImportModule, 'currentConfigOption'], $moduleParams); - // TODO 验证返回 - } - } - // if(empty($res)){ - // $res = ['status'=>400, 'msg'=>'module_file_is_not_exist']; - // } - return $res; - }*/ - - /** - * 时间 2023-01-30 - * @title 获取商品最低周期价格 - * @desc 获取商品最低周期价格 - * @author hh - * @version v1 - * @param int productId - 商品ID - * @return float price - 价格 - * @return string cycle - 周期 - * @return ProductModel product - ProductModel实例 - */ - // public function getPriceCycle($productId) - // { - // $res = [ - // 'price' => null, - // 'cycle' => null - // ]; - // $ProductModel = ProductModel::findOrEmpty($productId); - - // $module = $ProductModel->getModule(); - // if($ImportModule = $this->importModule($module)){ - // if(method_exists($ImportModule, 'getPriceCycle')){ - // $moduleRes = call_user_func([$ImportModule, 'getPriceCycle'], ['product'=>$ProductModel]); - // if(isset($moduleRes['price']) && is_numeric($moduleRes['price'])){ - // $res['price'] = $moduleRes['price']; - // } - // if(isset($moduleRes['cycle'])){ - // $res['cycle'] = $moduleRes['cycle']; - // } - // } - // } - // $res['product'] = $ProductModel; - // return $res; - // } - - - public function downloadResource($ProductModel){ - $apiId = $this->upstreamProduct['supplier_id']; - - $res = idcsmart_api_curl($apiId, sprintf('api/v1/product/%d/resource', $this->upstreamProduct['upstream_product_id']), [] ,30, 'GET'); - return $res; - } - - - - - /** - * 时间 2022-06-08 - * @title 验证模块名称是否正确 - * @desc 验证模块名称是否正确 - * @author hh - * @version v1 - * @param string $module - 模块名称 - * @return bool - */ - protected function checkModule($module){ - return (bool)preg_match('/^[a-z][a-z0-9_]{0,99}$/', $module); - } - - /** - * 时间 2022-05-16 - * @title 引入商品模块文件 - * @desc 引入商品模块文件 - * @author hh - * @version v1 - * @param string module - 模块类型 - * @return bool|object - - false=没有对应类,object=成功实例化模块类 - */ - protected function importModule($module = null) - { - $module = $module ?? $this->upstreamProduct['res_module']; - if(!empty($module)){ - $className = parse_name($module, 1); - - $class = '\reserver\\'.$module.'\\'.$className; - - if(class_exists($class)){ - return new $class(); - } - } - return false; - } - - /** - * 时间 2022-05-26 - * @title 格式化文本返回 - * @desc 格式化文本返回 - * @author hh - * @version v1 - * @param string $module 模块名称 - * @param mixed $res 模块返回 - * @return string - */ - private function formatTemplate($res = null): string - { - $html = ''; - $module = $module ?? $this->upstreamProduct['res_module']; - if(is_array($res)){ - // 认为是使用模板的方式来输出内容,格式大概如下 - // [ - // 'template'=>'abc.html', - // 'vars'=>[ - // 'aaaa'=>'bbb' - // ] - // ] - $template_file = $this->path . $module . '/' . $res['template']; - if(file_exists($template_file)){ - $PluginModel=new PluginModel(); - $addons = $PluginModel->plugins('addon')['list']; - - $vars = isset($res['vars']) && !empty($res['vars']) && is_array($res['vars']) ? $res['vars'] : []; - $vars['addons'] = $addons; - - View::assign($vars); - // 调用方法变量 - $html = View::fetch($template_file); - }else{ - $html = lang('module_cannot_find_template_file'); - } - }else if(is_string($res)){ - $html = $res; - }else{ - $html = (string)$res; - } - return $html; - } - - /** - * 时间 2022-05-13 - * @title 格式化系统操作返回 - * @desc 格式化系统操作返回 - * @author hh - * @version v1 - * @param mixed res - 操作返回 required - * @param string successMsg - 成功返回没有提示信息时,会用该信息提示 - * @param string failMsg - 失败返回没有提示信息时,会用该信息提示 - * @return array - */ - private function formatResult($res, $successMsg = '', $failMsg = ''): array - { - $result = []; - // 不兼容原来的老模块写法,都必须按标准返回 - if(is_array($res)){ - $result = $res; - - if($result['status'] === 400){ - $result['msg'] = $result['msg'] ?? ($failMsg ?: lang('module_operate_fail')); - }else if($result['status'] === 200){ - $result['msg'] = $result['msg'] ?? ($successMsg ?: lang('module_operate_success')); - }else{ - $result = []; - $result['status'] = 400; - $result['msg'] = lang('module_res_format_error'); - } - }else{ - $result = []; - $result['status'] = 400; - $result['msg'] = lang('module_res_format_error'); - // 原模块返回判断(废弃) - // if($res === null || $res == 'success' || $res == 'ok'){ - // $result['status'] = 200; - // $result['msg'] = '操作成功'; - // }else{ - // $result['status'] = 400; - // $result['msg'] = (string)$res; - // } - } - return $result; - } - - -} - - - diff --git a/10.2.2/app/common/model/SupplierModel.php b/10.2.2/app/common/model/SupplierModel.php deleted file mode 100644 index da3fc63c..00000000 --- a/10.2.2/app/common/model/SupplierModel.php +++ /dev/null @@ -1,265 +0,0 @@ - 'int', - 'name' => 'string', - 'url' => 'string', - 'username' => 'string', - 'token' => 'string', - 'secret' => 'string', - 'contact' => 'string', - 'notes' => 'string', - 'create_time' => 'int', - 'update_time' => 'int', - ]; - - # 供应商列表 - public function supplierList($param) - { - $param['keywords'] = $param['keywords'] ?? ''; - $param['orderby'] = isset($param['orderby']) && in_array($param['orderby'], ['id']) ? 'a.'.$param['orderby'] : 'a.id'; - - $where = function (Query $query) use ($param){ - if (!empty($param['keywords'])){ - $query->where('a.name|a.url','like',"%{$param['keywords']}%"); - } - }; - $count = $this->alias('a') - ->field('a.id') - ->where($where) - ->count(); - - - - $list = $this->alias('a') - ->field('a.id,a.name,a.url') - ->where($where) - ->group('a.id') - ->limit($param['limit']) - ->page($param['page']) - ->order($param['orderby'], $param['sort']) - ->select() - ->toArray(); - $supplierId = array_column($list, 'id'); - $productNum = UpstreamProductModel::field('COUNT(id) num,supplier_id')->whereIn('supplier_id', $supplierId)->group('supplier_id')->select()->toArray();; - $productNum = array_column($productNum, 'num', 'supplier_id'); - $hostNum = UpstreamHostModel::field('COUNT(id) num,supplier_id')->whereIn('supplier_id', $supplierId)->group('supplier_id')->select()->toArray();; - $hostNum = array_column($hostNum, 'num', 'supplier_id'); - - foreach ($list as $key => $value) { - $list[$key]['host_num'] = $hostNum[$value['id']] ?? 0; - $list[$key]['product_num'] = $productNum[$value['id']] ?? 0; - } - - return ['list' => $list, 'count' => $count]; - } - - # 供应商详情 - public function indexSupplier($id) - { - $supplier = $this->field('id,name,url,username,token,secret,contact,notes')->find($id); - if(empty($supplier)){ - return (object)[]; - } - $supplier['token'] = aes_password_decode($supplier['token']); - $supplier['secret'] = aes_password_decode($supplier['secret']); - return $supplier; - } - - # 添加供应商 - public function createSupplier($param) - { - - $this->startTrans(); - try{ - $supplier = $this->create([ - 'name' => $param['name'], - 'url' => $param['url'], - 'username' => $param['username'], - 'token' => aes_password_encode($param['token']), - 'secret' => aes_password_encode(str_replace("\r\n", "\n", $param['secret'])), - 'contact' => $param['contact'] ?? '', - 'notes' => $param['notes'] ?? '', - 'create_time' => time(), - ]); - - # 记录日志 - active_log(lang('log_create_supplier',['{admin}'=>request()->admin_name,'{name}'=>$param['name']]), 'supplier', $supplier->id); - $this->commit(); - }catch (\Exception $e){ - $this->rollback(); - return ['status'=>400, 'msg'=>lang('create_fail')]; - } - - return ['status'=>200, 'msg'=>lang('create_success')]; - } - - # 编辑供应商 - public function updateSupplier($param) - { - $supplier = $this->find($param['id']); - if(empty($supplier)){ - return ['status' => 400, 'msg' => lang('supplier_is_not_exist')]; - } - $supplier = $supplier->toArray(); - $token = aes_password_decode($supplier['token']); - $secret = aes_password_decode($supplier['secret']); - unset($supplier['token'],$supplier['secret']); - # 日志描述 - $logDescription = log_description($supplier,$param,'supplier'); - if($token!=$param['token']){ - $logDescription = $logDescription.','.lang('log_supplier_token'); - } - if($secret!=$param['secret']){ - $logDescription = $logDescription.','.lang('log_supplier_secret'); - } - $logDescription = ltrim(',', $logDescription); - - $this->startTrans(); - try{ - $this->update([ - 'name' => $param['name'], - 'url' => $param['url'], - 'username' => $param['username'], - 'token' => aes_password_encode($param['token']), - 'secret' => aes_password_encode(str_replace("\r\n", "\n", $param['secret'])), - 'contact' => $param['contact'] ?? '', - 'notes' => $param['notes'] ?? '', - 'update_time' => time(), - ], ['id' => $param['id']]); - - # 记录日志 - active_log(lang('log_update_supplier',['{admin}'=>request()->admin_name,'{name}'=>$param['name'],'{description}'=>$logDescription]),'supplier',$supplier['id']); - $this->commit(); - }catch (\Exception $e){ - $this->rollback(); - return ['status'=>400,'msg'=>lang('update_fail')]; - } - - return ['status'=>200,'msg'=>lang('update_success')]; - } - - # 删除供应商 - public function deleteSupplier($id) - { - $supplier = $this->find($id); - if(empty($supplier)){ - return ['status' => 400, 'msg' => lang('supplier_is_not_exist')]; - } - $productCount = UpstreamProductModel::where('supplier_id', $id)->count(); - if($productCount>0){ - return ['status' => 400, 'msg' => lang('cannot_delete_supplier')]; - } - - $this->startTrans(); - try{ - $this->destroy($id); - - # 记录日志 - active_log(lang('log_delete_supplier',['{admin}'=>request()->admin_name,'{name}'=>$supplier['name']]),'supplier',$supplier->id); - $this->commit(); - }catch (\Exception $e){ - $this->rollback(); - return ['status'=>400,'msg'=>lang('delete_fail')]; - } - - return ['status'=>200,'msg'=>lang('delete_success')]; - } - - # 检查供应商接口连接状态 - public function supplierStatus($id) - { - $supplier = $this->find($id); - if(empty($supplier)){ - return ['status' => 400, 'msg' => lang('supplier_is_not_exist')]; - } - // 从上游商品详情拉取 - $UpstreamLogic = new UpstreamLogic(); - $res = $UpstreamLogic->upstreamApiAuth(['url' => $supplier['url'], 'username' => $supplier['username'], 'password' => aes_password_decode($supplier['token'])]); - if($res['status']==400){ - return ['status'=>400,'msg'=>$res['msg']]; - } - return ['status'=>200,'msg'=>lang('success_message')]; - } - - # 获取供应商商品列表 - public function supplierProduct($id) - { - $supplier = $this->find($id); - if(empty($supplier)){ - return ['list' => [], 'count' => 0]; - } - // 从上游商品详情拉取 - $UpstreamLogic = new UpstreamLogic(); - $res = $UpstreamLogic->upstreamProductList(['url' => $supplier['url']]); - return $res; - } - - public function apiAuth($api_id,$force) - { - $this->startTrans(); - - try{ - $path='api/v1/auth'; - - $supplier = $this->where('id',$api_id)->find(); - if (empty($supplier)){ - throw new \Exception(lang('supplier_is_not_exist')); - } - $url = rtrim($supplier['url'],'/'); - - $key = 'api_auth_login_' . AUTHCODE . '_' . $api_id; - - $jwt = idcsmart_cache($key); - - if (empty($jwt) || $force){ - - $apiUrl = $url . '/' . $path; - - $data = [ - 'username' => $supplier['username'], - 'password' => aes_password_decode($supplier['token']) - ]; - - $result = curl($apiUrl,$data); - if ($result['http_code']!=200){ - idcsmart_cache($key,null); - throw new \Exception($result['content']??"api_auth_fail"); - } - $result = json_decode($result['content'], true); - - if($result['status'] == 200){ - $jwt = $result['data']['jwt']; - - idcsmart_cache($key,$jwt,2*3600); - }else{ - throw new \Exception($result['msg']??"api_auth_fail"); - } - } - - $this->commit(); - }catch (\Exception $e){ - $this->rollback(); - - return ['status'=>400,'msg'=>$e->getMessage()]; - } - - return ['status'=>200,'msg'=>lang('success_message'),'data'=>['jwt'=>$jwt,'url'=>$url]]; - } -} \ No newline at end of file diff --git a/10.2.2/public/admin/template/default/captcha.php b/10.2.2/public/admin/template/default/captcha.php deleted file mode 100644 index 31e9291e..00000000 --- a/10.2.2/public/admin/template/default/captcha.php +++ /dev/null @@ -1,111 +0,0 @@ -{include file="header"} - - -
- - -
- {{lang.get_more}} - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- {{lang.hold}} - {{lang.cancel}} -
-
-
- - - - - - - - - - -
- - - -{include file="footer"} \ No newline at end of file diff --git a/10.2.2/public/admin/template/default/client_detail.php b/10.2.2/public/admin/template/default/client_detail.php deleted file mode 100644 index e71e3847..00000000 --- a/10.2.2/public/admin/template/default/client_detail.php +++ /dev/null @@ -1,308 +0,0 @@ -{include file="header"} - - - -
- -
- {{lang.user_manage}} - - {{lang.user_list}} - - {{lang.personal}} -
- -
- - - - #{{data.id}}-{{data.username ? data.username : (data.phone? data.phone: data.email)}} - ({{data.company}}) - - - #{{item.id}}-{{item.username ? item.username : (item.phone? item.phone: item.email)}} - ({{item.company}}) - - -
-
- - - -

{{ lang.basic_info }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -

{{lang.financial_info}}

-
- - - {{lang.Recharge}} - - -
- {{lang.change_log}} - {{lang.change_log}} -
-
- - -

{{lang.credit}}

- -
- -

{{lang.consume}}

- -
- -

{{lang.Refund}} - - - -

- -
- -

{{lang.withdraw}}

- -
-
-

{{lang.product_info}}

- - -

{{lang.host_num}}

- -
- -

{{lang.host_active_num}}

- -
-
-

{{lang.other_info}}

- - -

{{lang.register_time}}

- -
- -

{{lang.last_login_time}}

- -
- -

{{lang.last_login_ip}}

- -
-
-
-
- - - - -
- - -
- - - - - - - - - - - - - - - -
- {{lang.sure+lang.Recharge}} - {{lang.cancel}} -
-
-
- - - - - - - - - - - - - - - - -
- {{lang.submit}} - {{lang.cancel}} -
-
-
- - -
- - - - - - - -
-
- - - - - - - - -
- - - - -{include file="footer"} \ No newline at end of file diff --git a/10.2.2/public/clientarea/template/default/js/newsView.js b/10.2.2/public/clientarea/template/default/js/newsView.js deleted file mode 100644 index 1fb88362..00000000 --- a/10.2.2/public/clientarea/template/default/js/newsView.js +++ /dev/null @@ -1,56 +0,0 @@ -(function (window, undefined) { - var old_onload = window.onload - window.onload = function () { - const template = document.getElementById('content') - Vue.prototype.lang = window.lang - Vue.prototype.moment = window.moment - new Vue({ - created() { - this.init() - }, - computed: { - calStr() { - return (str) => { - const temp = str && str.replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'). - replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/ &lt;/g, '<').replace(/&gt; /g, '>') - .replace(/&gt; /g, '>').replace(/&quot;/g, '"').replace(/&amp;nbsp;/g, ' ').replace(/&#039;/g, '\''); - return temp - } - } - }, - data() { - return { - newDetail: {} - } - }, - filters: { - formateTime(time) { - if (time && time !== 0) { - var date = new Date(time * 1000); - Y = date.getFullYear() + '-'; - M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; - D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '; - h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'; - m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes(); - return (Y + M + D + h + m); - } else { - return "--"; - } - }, - }, - methods: { - init() { - this.newDetail = JSON.parse(sessionStorage.viewNewObjData) - this.newDetail.create_time = new Date().getTime() / 1000 - }, - }, - - }).$mount(template) - - const mainLoading = document.getElementById('mainLoading') - setTimeout(() => { - mainLoading && (mainLoading.style.display = 'none') - }, 200) - typeof old_onload == 'function' && old_onload() - }; -})(window); diff --git a/10.2.2/public/plugins/addon/idcsmart_withdraw/template/admin/withdrawal_create.php b/10.2.2/public/plugins/addon/idcsmart_withdraw/template/admin/withdrawal_create.php deleted file mode 100644 index 5e446e09..00000000 --- a/10.2.2/public/plugins/addon/idcsmart_withdraw/template/admin/withdrawal_create.php +++ /dev/null @@ -1,155 +0,0 @@ - - - -
- -

{{lang.order_new + lang.withdraw}}

-
- - - -

{{lang.withdrawal_source}}

- - - - - - -
- -

{{lang.withdrawal_way}}

- - - - - - ({{lang.multiple}}) - -
- -

{{lang.withdrawal_process}}

- - - - - - -
-
- - - -

{{lang.min_money_limit}}

- - - - ({{lang.no_limit}}) - -
-
- - -

{{lang.max_money_limit}}

- - - - ({{lang.no_limit}}) - -
-
- - - -

{{lang.withdrawal_cycle_limit}}

- - - - - - -
- -

- - - - {{lang.sequence}} - ({{lang.no_limit}}) - -
-
- - - -

{{lang.commission}}

- - - - - - -
- - -
-
- {{lang.hold}} - {{lang.cancel}} -
-
-
-
-
- - - \ No newline at end of file diff --git a/10.2.2/public/theme/activities.html b/10.2.2/public/theme/activities.html deleted file mode 100644 index a2257140..00000000 --- a/10.2.2/public/theme/activities.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智简魔方 - - - - - -
-
-

最新活动

-

最新活动专区,您可了解主题云当前所有优惠活动

-
-
- - - -
- -

暂无活动

-
- - - - - - - - - - \ No newline at end of file diff --git a/10.2.2/public/theme/announce-details.html b/10.2.2/public/theme/announce-details.html deleted file mode 100644 index 19aa7f3c..00000000 --- a/10.2.2/public/theme/announce-details.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智简魔方 - - - - - -
-
-
- -
-
-

云视频交付实施服务于2023年2月8日00:00(北京时间)价格调整通知

-

2022-12-21

-
- 近日,华为云关注到Xstream官方发布安全公告,披露在1.4.20之前的版本中存在一处高风险级别的拒绝服务漏洞(CVE-2022-41966)。漏洞允许远程攻击者通过操纵已处理的输入流触发堆栈溢出,致使应用程序终止,从而导致拒绝服务。目前漏洞细节与POC已公开,风险高。 - - XStream是Java类库,用来将对象序列化成XML (JSON)或 -
- -
-
-
- - - - - \ No newline at end of file diff --git a/10.2.2/public/theme/announce.html b/10.2.2/public/theme/announce.html deleted file mode 100644 index e16648d7..00000000 --- a/10.2.2/public/theme/announce.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智简魔方 - - - - - - - - -
-
-
- -
-
-
-
- -
-

XStream 拒绝服务漏洞预警

-

2022年12月9日

-
-
-

OpenSSL缓冲区溢出漏洞预警

-

2022年11月2日

-
-
-

Linux Kernel 权限提升漏洞预警 -

-

2022年9月22日

-
-
-

Apache Spark 命令注入漏洞预警 -

-

2022年7月19日

-
-
-
- -
-
-
-
- - -
-

主题云2023年五一放假公告

-

2023年4月24日

-
-
-

主题云2023年春节放假公告 -

-

2023年1月12日

-
- -
-
- -
-
- -
-
-
- - - - - - - \ No newline at end of file diff --git a/10.2.2/public/theme/assets/img/cloud/banner.png b/10.2.2/public/theme/assets/img/cloud/banner.png deleted file mode 100644 index 6ce107bc..00000000 Binary files a/10.2.2/public/theme/assets/img/cloud/banner.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/dedicated/banner.png b/10.2.2/public/theme/assets/img/dedicated/banner.png deleted file mode 100644 index 4f184b62..00000000 Binary files a/10.2.2/public/theme/assets/img/dedicated/banner.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/document/banner.png b/10.2.2/public/theme/assets/img/document/banner.png deleted file mode 100644 index 31f8e2d5..00000000 Binary files a/10.2.2/public/theme/assets/img/document/banner.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/index/map.png b/10.2.2/public/theme/assets/img/index/map.png deleted file mode 100644 index 60bf67eb..00000000 Binary files a/10.2.2/public/theme/assets/img/index/map.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/index/register@2x.png b/10.2.2/public/theme/assets/img/index/register@2x.png deleted file mode 100644 index 7f51ee7c..00000000 Binary files a/10.2.2/public/theme/assets/img/index/register@2x.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/solution/agriculture_05.png b/10.2.2/public/theme/assets/img/solution/agriculture_05.png deleted file mode 100644 index 1e3d11b9..00000000 Binary files a/10.2.2/public/theme/assets/img/solution/agriculture_05.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/solution/auto_05.png b/10.2.2/public/theme/assets/img/solution/auto_05.png deleted file mode 100644 index c79b120b..00000000 Binary files a/10.2.2/public/theme/assets/img/solution/auto_05.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/solution/education_05.png b/10.2.2/public/theme/assets/img/solution/education_05.png deleted file mode 100644 index e3d573cf..00000000 Binary files a/10.2.2/public/theme/assets/img/solution/education_05.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/solution/finance_05.png b/10.2.2/public/theme/assets/img/solution/finance_05.png deleted file mode 100644 index bc446d8c..00000000 Binary files a/10.2.2/public/theme/assets/img/solution/finance_05.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/solution/game_05.png b/10.2.2/public/theme/assets/img/solution/game_05.png deleted file mode 100644 index af97ca84..00000000 Binary files a/10.2.2/public/theme/assets/img/solution/game_05.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/solution/medical_05.png b/10.2.2/public/theme/assets/img/solution/medical_05.png deleted file mode 100644 index 2cc77a98..00000000 Binary files a/10.2.2/public/theme/assets/img/solution/medical_05.png and /dev/null differ diff --git a/10.2.2/public/theme/assets/img/solution/travel_05.png b/10.2.2/public/theme/assets/img/solution/travel_05.png deleted file mode 100644 index dcdb4990..00000000 Binary files a/10.2.2/public/theme/assets/img/solution/travel_05.png and /dev/null differ diff --git a/10.2.2/public/theme/cloud.html b/10.2.2/public/theme/cloud.html deleted file mode 100644 index e337d320..00000000 --- a/10.2.2/public/theme/cloud.html +++ /dev/null @@ -1,580 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智简魔方 - - - - - - - - -
-
-
-

产品规格

-
多规格实例组合,轻松应对不同应用场景的个性化算力诉求
-
-
- - - - -
-
-
- - - -
-
-
-

产品优势

-
服务集成,专业支撑,帮助您快速部署云端业务
-
-
-
-
-
-

核心高效

-
性能强劲的硬件设施,结合主题云前沿处理技术,为广大用户提供坚实的数据处理平台,轻松应对各类业务负载。
-
-
-
-
-
-

强大易用

-
主题云拥有成熟的规格组合与丰富的镜像类型,覆盖各种应用场景,满足所有用户在线业务的快速部署、灵活管理需求。
-
-
-
-
-
-

稳定可靠

-
主题云单个服务器可用性达99.99%,云硬盘数据持续性99.9999999%,运行环境稳定可靠,有效保证数据与服务的高可用性。
-
-
-
-
-
-

高性价比

-
支持灵活选择资源配置,后期可随时根据业务需求调整实例规格,极大节省了前期搭建基础网络设施的成本和后期的维护成本。
-
-
-
-
-
- - -
-
-
-

产品特性

-
高效能弹性计算服务,助推企业数智发展
-
-
-
-
-
-
-
-
秒级创建
-
单台实例秒级完成创建,分钟级批量创建多台服务器,无需考虑采购与运维成本。
-
-
-
-
-
-
弹性灵活
-
支持随时扩展或缩减实例配置,精确匹配业务诉求,助您低成本轻松上云。
-
-
-
-
-
-
多重安全防护
-
云服务器运行在逻辑隔离的私有网络中,三副本容灾存储,确保用户数据安全可控。
-
-
-
-
-
-
智能调度
-
基于主题云大规模分布式集群下的智能调度,实现节点故障无感秒级迁移。
-
-
-
-
-
-
管理简单
-
通过控制台直接操控多台云服务器,就像管理您的计算机一样简单方便。
-
-
-
-
-
-
高效计算能力
-
多规格自选,单实例最高可选择128vCPU,内存512GB,满足高端计算需求。
-
-
-
-
-
-
- - -
-
-
-

应用场景

-
赋能多元化场景应用,全方位探索云上新生态
-
-
- - - - -
-
-
-
细分场景
-

网站开发、测试环境、媒体网站、资讯应用、企业网站、博客论坛等。

- -
-
-
场景痛点
-
-

采购服务器成本较高,初始投入成本高。

-
-
-

后期运维过于专业,缺乏专业人才。

-
-
-

访问量不定时激增,传统服务器无法负荷,扩容成本高且造成资源浪费。

-
- -
- -
-
解决方案
- 云服务器 -
- -
-
应用成果
-
-

轻量型云服务器,即开即用,一次性投入成本低,经济实惠。

-
-
-

云服务器可弹性调整配置规格,秒级交付,灵活应对流量激增。

-
-
-

多重安全防护,无需专人运维,有效保障业务安全稳定运行。

-
- -
-
-
-
-
-
细分场景
-

手游、端游、在线直播、在线教育等应用。

- -
-
-
场景痛点
-
-

对服务器性能要求极高,设备采购与维护成本过高。

-
-
-

传统服务器会造成卡顿、掉线等严重问题,影响用户体验。

-
- -
- -
-
解决方案
- 云服务器 -
- -
-
应用成果
-
-

根据业务情况灵活选配高性能资源配置,灵活实惠。

-
-
-

提供高I/O能力和快速的数据交换处理能力,给用户高清流畅的使用体验。

-
-
-
-
-
-
-
-
细分场景
-

秒杀应用、抢红包应用、优惠券发放应用、电商网站、票务网站等。

- -
-
-
场景痛点
-
-

数据量大,要求快速地数据交换与处理,对服务器性能要求较高,设备采购成本高。

-
-
-

促销期间访问流量暴增,系统响应慢,产品状态更新不及时,造成大量用户投诉。

-
- -
- -
-
解决方案
- 云服务器 -
- -
-
应用成果
-
-

性能均衡的计算、内存与网络服务能力,在节省成本的同时提供有力的服务支撑。

-
-
-

灵活调整实例数量,实现访问量高低峰时期的无缝转换。

-
- -
-
-
-
-
-
-
细分场景
-

视频网站、设计素材网站、资源下载应用、网盘应用等。

- -
-
-
场景痛点
-
-

涉及海量静态数据,网页加载速度慢,用户体验差。

-
-
-

业务数据量不断增大,对计算资源需求较大,带来成本压力。

-
- -
- -
-
解决方案
- 云服务器 -
- -
-
应用成果
-
-

存储容量做到低成本、高可靠性,实现高清流畅的浏览体验。

-
-
-

海量计算资源随开随用,弹性扩容,轻松适应不断增长的业务需求。

-
- -
-
-
-
- - -
-
-
- - -
-
-
-

使用帮助

- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/10.2.2/public/theme/css/agent.css b/10.2.2/public/theme/css/agent.css deleted file mode 100644 index 41a1d5a6..00000000 --- a/10.2.2/public/theme/css/agent.css +++ /dev/null @@ -1,218 +0,0 @@ -.agent-advantage{ - background: rgba(247, 248, 250, 1); -} -.agent-advantage .advantage{ - padding-top: 60px; -} -.agent-advantage .advantage-left -{ - padding: 40px 20px; - color: #fff; - background: url('../assets/img/reward/group-1.png'); - background-size: cover; - min-width: 280px; -} - - - -.agent-advantage .advantage-right{ - display: flex; - background: #fff; -} - -.agent-advantage .advantage-right .advantage-box{ - display: flex; - position: relative; - padding: 60px 50px; - height: 183px; - padding-bottom: 0; - /* border: 1px solid #EDEDED; */ - -} -.agent-advantage .advantage-right .advantage-right-box .advantage-box:first-child{ - border-bottom: 1px solid #EDEDED; -} -.agent-advantage .advantage-right .advantage-right-box:first-child .advantage-box{ - border-right: 1px solid #EDEDED; -} -/* .agent-advantage .advantage-right .advantage-box1::before{ - content: ''; - position: absolute; - left: 0; - bottom: -1px; - width: 60px; - border: 1px solid #fff; -} - -.agent-advantage .advantage-right .advantage-box2::before{ - content: ''; - position: absolute; - right: -1px; - bottom: -1px; - height: 60px; - border: 1px solid #fff; -} -.agent-advantage .advantage-right .advantage-box3::before{ - content: ''; - position: absolute; - left: -1px; - top: 0; - height: 60px; - border: 1px solid #fff; -} -.agent-advantage .advantage-right .advantage-box4::before{ - content: ''; - position: absolute; - right: 0; - top: -1px; - width: 60px; - border: 1px solid #fff; -} */ - - - -.agent-advantage .advantage-box img{ - min-width: 88px; - height: 88px; - - opacity: 1; - margin-right: 20px; -} - -.agent-advantage .advantage-box h4{ - margin-bottom: 10px; -} - -/* 代理支持 */ -.agent-support{ - -} - -.agent-support .support{ - margin: -10px; - margin-top: 60px; - color: rgba(0, 0, 0, 0.90); -} - -.agent-support .support .support-box{ - flex: 1; - margin: 10px; - background: #fff; - border-top: 4px solid rgba(255, 103, 57, 1); - border-radius: 0px 0px 3px 3px; - box-shadow: 0px 0px 16px rgba(0,0,0,0.08); -} - -.agent-support .support .support-box .support-head{ - padding: 30px 0; - border-bottom: 1px solid #EDEDED; - text-align: center; -} - -.agent-support .support .support-box .support-cont{ - padding: 40px 60px 70px 60px; - font-size: 16px; -} -.agent-support .support .support-box .support-cont p{ - margin-bottom: 6px; -} -.agent-support .support .support-box .support-cont .icon-right{ - color: rgba(255, 103, 57, 1); - margin-right: 10px; -} - - -/* 加入条件 */ -.agent-condition .cloud { - flex-wrap: nowrap!important; -} - -.agent-condition .cloud .cloud-box{ - min-width: auto; - } - -/* 代理流程 */ -.agent-flow .flow{ - display: flex; - flex-wrap: wrap; - margin: -20px; - margin-top: 60px; -} -.agent-flow .flow>div{ - margin: 15px; -} -.agent-flow .flow-box{ - position: relative; - padding: 10px 10px 40px 40px; - width: 280px; - height: 360px; - -background: linear-gradient(134deg, #FFFFFF 0%, #FAFAFA 100%); - box-shadow: 0px 0px 10px rgba(19,55,83,0.08); - opacity: 1; - border-radius: 3px; -} - - - -.agent-flow .flow-box .number{ - font-size: 70px; - font-weight: bold; -} - -.agent-flow .flow-box img{ - width: 128px; - height: 128px; - background: rgba(0, 0, 0, 0.40); -} - -.agent-flow .flow-box h5{ - margin-top: 50px; - margin-bottom: 10px; -} - -.agent-flow .flow-box .title-desc{ - height: 32px; -} - -.agent-flow .flow-box .btn{ - padding: 8px 32px; -} -.agent-flow .icon-right1{ - color: rgba(153, 153, 153, 1); -} - -/* 常见问题 */ -.agent-question{ - background: #F7F8FA; -} - -.agent-question .question{ - padding: 40px; - margin-top: 60px; - background: #fff; -} - -.agent-question .question .panel, -.agent-question .question .panel-heading, -.agent-question .question .panel-body -{ - background: transparent; - border: none !important; -} - -.agent-question .question .panel{ - box-shadow: none; -} - -.agent-question .question .panel-body{ - background: rgba(247, 248, 250, 1); - color: rgba(0, 0, 0, 0.60); - width: 100%; -} - -.agent-question .question .panel-heading a{ - text-decoration: none; -} - - diff --git a/10.2.2/public/theme/dedicated.html b/10.2.2/public/theme/dedicated.html deleted file mode 100644 index 617d5b1d..00000000 --- a/10.2.2/public/theme/dedicated.html +++ /dev/null @@ -1,496 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智简魔方 - - - - - - - - -
-
-
-

产品规格

-
多规格实例组合,轻松应对不同应用场景的个性化算力诉求
-
-
- - - - -
-
-
- - - -
-
-
-

产品优势

- -
-
-
-
-
-

高配硬件

-
所有硬件均采用国际顶级品牌,支持深度定制硬件,充分满足不同业务场景下的高性能应用需求。
-
-
-
-
-
-

快速响应

-
专业运维团队全天候监控,借助先进的监控与故障诊断技术,自动发现服务器的常见故障,有效保障设备的高可用性。
-
-
-
-
-
-

安全合规

-
用户独享物理裸机,实现更高等级的安全隔离,满足金融、政务等领域特殊的合规监管、安全要求。
-
-
-
-
-
-

性能无损

-
多种高规则配置按需选配,无虚拟化损失,无资源争抢,100%释放算力资源,随时展现超高性能。
-
-
-
-
-
- - -
-
-
-

产品特性

-
-
-
-
-
-
-
-
可定制硬件
-
硬件配置可随时更换或扩容,免费定期硬件维保,安全放心。
-
-
-
-
-
-
资源独享
-
完全独享CPU、内存、磁盘、网络等计算资源,拥有卓越计算性能。
-
-
-
-
-
-
智能管理
-
一键式远程执行服务器的重启、开关机命令,敏捷高效。
-
-
-
-
-
-
可视化监管
-
自动生成可视化流量统计图,实时监控带宽速率、流量消耗情况。
-
-
- -
-
-
-
- - -
-
-
-

应用场景

-
-
- - - - -
-
-
-
需求场景
-

超算中心、数据分析等高性能计算场景,数据处理量大,对服务器的计算性能、稳定性、实时性等要求很高。

- -
-
-
应用成果
-
-

独占资源

-

独占计算资源,无资源争抢。

-
-
-

强劲性能

-

全新硬件设备,提供强大计算能力。

-
-
-

无虚拟化损失

-

机器无虚拟化开销,用户使用全部计算能力。

-
- -
- - -
-
-
-
-
需求场景
-

某些关键的数据库业务不能部署在虚拟机上,必须通过资源专享、网络隔离、性能有保障的物理裸机承载。

- -
-
-
应用成果
-
-

安全隔离

-

CPU、内存、磁盘、网络等计算资源完全隔离。

-
-
-

高数据可靠

-

可根据业务需求随时扩容。

-
-
-
-
-
-
-
-
需求场景
-

金融、证券等行业对业务部署的合规性,以及某些客户对数据安全有极高的要求。

- -
-
-
应用成果
-
-

安全合规

-

用户独享物理隔离的计算资源。

-
-
-

专线接入

-

专线网络保障数据传输安全稳定。

-
- -
- -
-
- -
- - -
-
-
- - -
-
-
-

使用帮助

- -
- -
-
- - - - - - - \ No newline at end of file diff --git a/10.2.2/public/theme/document-result.html b/10.2.2/public/theme/document-result.html deleted file mode 100644 index 411c8aba..00000000 --- a/10.2.2/public/theme/document-result.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智简魔方 - - - - - - - - -
-
-
-

搜索词“服务"

-
-
- -
号码隐私服务保护PNS_隐私服务_号码隐私服务_通话保护-百度智能云
-
-

号码隐私保护服务PNS 号码隐私保护服务(Privacy Number Service,简称PNS)为用户或企业分配隐私号码, - 保证通话过程中号码信息不被泄露。并可通过隐私号对通话进行录音,提升服务安全性及服务质量。同时可在信息隔离的使用场景中,做流量的监控。(Privacy Number Service,简称PNS)为用户或企业分配隐私号码,保证通话过程中号码信息不被泄露。并可通过隐私号对通话进行录音,提升服务安全性及服务质量。同时

-
来自: 产品 > 帮助中心
-
- -
-
-
- -
号码隐私服务保护PNS_隐私服务_号码隐私服务_通话保护-百度智能云
-
-

号码隐私保护服务PNS 号码隐私保护服务(Privacy Number Service,简称PNS)为用户或企业分配隐私号码, - 保证通话过程中号码信息不被泄露。并可通过隐私号对通话进行录音,提升服务安全性及服务质量。同时可在信息隔离的使用场景中,做流量的监控。(Privacy Number Service,简称PNS)为用户或企业分配隐私号码,保证通话过程中号码信息不被泄露。并可通过隐私号对通话进行录音,提升服务安全性及服务质量。同时

-
来自: 产品 > 帮助中心
-
-
-
-
-
-
-
相关标签
-
- -
-
-
-
- - - - - - - \ No newline at end of file diff --git a/10.2.2/public/theme/js/document_index.js b/10.2.2/public/theme/js/document_index.js deleted file mode 100644 index 923afb6d..00000000 --- a/10.2.2/public/theme/js/document_index.js +++ /dev/null @@ -1,30 +0,0 @@ -$(function () { - // 获取列表 - function getHelpLlis() { - $.ajax({ - url: "/console/v1/help", - method: 'get', - success: function (res) { - res.data.list.forEach((item, index) => { - $('#docement-list').append(` -
-
- -
${item.name}
-
-
-
- `) - if (item.helps.length !== 0) { - item.helps.slice(0, 6).forEach((helps) => { - $(`#document-item${item.id}`).append(` -

${helps.title}

- `) - }) - } - }) - } - }) - } - getHelpLlis() -}) diff --git a/10.2.2/public/theme/news-classify.html b/10.2.2/public/theme/news-classify.html deleted file mode 100644 index fafb5df9..00000000 --- a/10.2.2/public/theme/news-classify.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智简魔方 - - - - - -
-
-
- -
-
- 新闻分类一 -
- -
-
- - - - - \ No newline at end of file diff --git a/10.2.2/public/theme/news.html b/10.2.2/public/theme/news.html deleted file mode 100644 index 1d6b5203..00000000 --- a/10.2.2/public/theme/news.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 智简魔方 - - - - - - -
-
- - - -
-
- - - - - - \ No newline at end of file diff --git a/10.2.2/public/upgrade/upgrade.log b/10.2.2/public/upgrade/upgrade.log deleted file mode 100644 index 2a82f0d7..00000000 --- a/10.2.2/public/upgrade/upgrade.log +++ /dev/null @@ -1,3 +0,0 @@ -20230118,10.2.0,20230118更新,10.2.0.sql -20230202,10.2.1,20230202更新,10.2.1.sql -20230308,10.2.2,20230308更新,10.2.2.sql \ No newline at end of file diff --git a/10.2.2.version b/10.2.5.version similarity index 100% rename from 10.2.2.version rename to 10.2.5.version diff --git a/10.2.2/app/admin/controller/AdminBaseController.php b/10.2.5/app/admin/controller/AdminBaseController.php similarity index 100% rename from 10.2.2/app/admin/controller/AdminBaseController.php rename to 10.2.5/app/admin/controller/AdminBaseController.php diff --git a/10.2.2/app/admin/controller/AdminController.php b/10.2.5/app/admin/controller/AdminController.php similarity index 98% rename from 10.2.2/app/admin/controller/AdminController.php rename to 10.2.5/app/admin/controller/AdminController.php index 21b78f35..bfc61345 100644 --- a/10.2.2/app/admin/controller/AdminController.php +++ b/10.2.5/app/admin/controller/AdminController.php @@ -25,7 +25,8 @@ public function initialize() * @method GET * @author wyh * @version v1 - * @param string keywords - 关键字 + * @param string keywords - 关键字:ID,名称,用户名,邮箱 + * @param string status - 状态0:禁用,1:正常 * @param int page - 页数 * @param int limit - 每页条数 * @param string orderby - 排序 id,nickname,name,email diff --git a/10.2.2/app/admin/controller/AdminRoleController.php b/10.2.5/app/admin/controller/AdminRoleController.php similarity index 100% rename from 10.2.2/app/admin/controller/AdminRoleController.php rename to 10.2.5/app/admin/controller/AdminRoleController.php diff --git a/10.2.2/app/admin/controller/AppMarketController.php b/10.2.5/app/admin/controller/AppMarketController.php similarity index 100% rename from 10.2.2/app/admin/controller/AppMarketController.php rename to 10.2.5/app/admin/controller/AppMarketController.php diff --git a/10.2.2/app/admin/controller/BaseController.php b/10.2.5/app/admin/controller/BaseController.php similarity index 100% rename from 10.2.2/app/admin/controller/BaseController.php rename to 10.2.5/app/admin/controller/BaseController.php diff --git a/10.2.2/app/admin/controller/ClientController.php b/10.2.5/app/admin/controller/ClientController.php similarity index 96% rename from 10.2.2/app/admin/controller/ClientController.php rename to 10.2.5/app/admin/controller/ClientController.php index db8e189b..4607fe76 100644 --- a/10.2.2/app/admin/controller/ClientController.php +++ b/10.2.5/app/admin/controller/ClientController.php @@ -96,6 +96,10 @@ public function clientList() * @return array client.login_logs - 登录记录 * @return string client.login_logs[].ip - IP * @return int client.login_logs[].login_time - 登录时间 + * @return boolean client.certification 是否实名认证 + * @return object client.certification_detail 实名认证详情(当certification==true时,才会有此字段) + * @return object client.certification_detail.company 企业实名认证详情 + * @return object client.certification_detail.person 个人实名认证详情 */ public function index() { diff --git a/10.2.2/app/admin/controller/ClientCreditController.php b/10.2.5/app/admin/controller/ClientCreditController.php similarity index 100% rename from 10.2.2/app/admin/controller/ClientCreditController.php rename to 10.2.5/app/admin/controller/ClientCreditController.php diff --git a/10.2.5/app/admin/controller/ClientRecordController.php b/10.2.5/app/admin/controller/ClientRecordController.php new file mode 100644 index 00000000..0d643cb1 --- /dev/null +++ b/10.2.5/app/admin/controller/ClientRecordController.php @@ -0,0 +1,146 @@ +validate = new ClientRecordValidate(); + } + + /** + * 时间 2023-03-21 + * @title 用户信息记录列表 + * @desc 用户信息记录列表 + * @author theworld + * @version v1 + * @url /admin/v1/client/:id/record + * @method GET + * @param int page - 页数 + * @param int limit - 每页条数 + * @return array list - 用户信息记录 + * @return int list[].id - 用户信息记录ID + * @return string list[].content - 内容 + * @return array list[].attachment - 附件 + * @return int list[].admin_id - 管理员ID + * @return string list[].admin_name - 管理员名称 + * @return int list[].create_time - 创建时间 + * @return int count - 用户信息记录总数 + */ + public function list() + { + // 合并分页参数 + $param = array_merge($this->request->param(), ['page' => $this->request->page, 'limit' => $this->request->limit, 'sort' => $this->request->sort]); + + // 实例化模型类 + $ClientRecordModel = new ClientRecordModel(); + + // 获取用户信息记录列表 + $data = $ClientRecordModel->clientRecordList($param); + + $result = [ + 'status' => 200, + 'msg' => lang('success_message'), + 'data' => $data + ]; + return json($result); + } + + /** + * 时间 2023-03-21 + * @title 新增用户信息记录 + * @desc 新增用户信息记录 + * @author theworld + * @version v1 + * @url /admin/v1/client/:id/record + * @method POST + * @param int id - 用户ID required + * @param string content - 名称 required + * @param array attachment - 附件 + */ + public function create() + { + // 接收参数 + $param = $this->request->param(); + + // 参数验证 + if (!$this->validate->scene('create')->check($param)){ + return json(['status' => 400 , 'msg' => lang($this->validate->getError())]); + } + + // 实例化模型类 + $ClientRecordModel = new ClientRecordModel(); + + // 新增用户信息记录 + $result = $ClientRecordModel->createClientRecord($param); + + return json($result); + } + + /** + * 时间 2023-03-21 + * @title 编辑用户信息记录 + * @desc 编辑用户信息记录 + * @author theworld + * @version v1 + * @url /admin/v1/client/record/:id + * @method PUT + * @param int id - 用户信息记录ID required + * @param string content - 名称 required + * @param array attachment - 附件 + */ + public function update() + { + // 接收参数 + $param = $this->request->param(); + + // 参数验证 + if (!$this->validate->scene('update')->check($param)){ + return json(['status' => 400 , 'msg' => lang($this->validate->getError())]); + } + + // 实例化模型类 + $ClientRecordModel = new ClientRecordModel(); + + // 编辑用户信息记录 + $result = $ClientRecordModel->updateClientRecord($param); + + return json($result); + } + + /** + * 时间 2023-03-21 + * @title 删除用户信息记录 + * @desc 删除用户信息记录 + * @author theworld + * @version v1 + * @url /admin/v1/client/record/:id + * @method DELETE + * @param int id - 用户信息记录ID required + */ + public function delete() + { + // 接收参数 + $param = $this->request->param(); + + // 实例化模型类 + $ClientRecordModel = new ClientRecordModel(); + + // 删除用户信息记录 + $result = $ClientRecordModel->deleteClientRecord($param['id']); + + return json($result); + + } + + +} \ No newline at end of file diff --git a/10.2.2/app/admin/controller/CommonController.php b/10.2.5/app/admin/controller/CommonController.php similarity index 99% rename from 10.2.2/app/admin/controller/CommonController.php rename to 10.2.5/app/admin/controller/CommonController.php index 73d8eb8f..bcb10e4d 100644 --- a/10.2.2/app/admin/controller/CommonController.php +++ b/10.2.5/app/admin/controller/CommonController.php @@ -340,7 +340,7 @@ public function upload() * @method GET * @author theworld * @version v1 - * @param keywords string - 关键字,搜索范围:用户姓名,公司,邮箱,手机号,商品名称,商品一级分组名称,商品二级分组名称,产品ID,标识,商品名称 required + * @param keywords string - 关键字,搜索范围:用户姓名,公司,邮箱,手机号,备注,商品名称,商品一级分组名称,商品二级分组名称,产品ID,标识,商品名称 required * @return array clients - 用户 * @return int clients[].id - 用户ID * @return string clients[].username - 姓名 diff --git a/10.2.2/app/admin/controller/ConfigurationController.php b/10.2.5/app/admin/controller/ConfigurationController.php similarity index 96% rename from 10.2.2/app/admin/controller/ConfigurationController.php rename to 10.2.5/app/admin/controller/ConfigurationController.php index e916ee61..6f463f6a 100644 --- a/10.2.2/app/admin/controller/ConfigurationController.php +++ b/10.2.5/app/admin/controller/ConfigurationController.php @@ -545,6 +545,13 @@ public function certificationUpdate() * @return string enterprise_mailbox - 企业邮箱 * @return string enterprise_qrcode - 企业二维码 * @return string online_customer_service_link - 在线客服链接 + * @return string icp_info - ICP信息 + * @return string icp_info_link - ICP信息信息链接 + * @return string public_security_network_preparation - 公安网备 + * @return string public_security_network_preparation_link - 公安网备链接 + * @return string telecom_appreciation - 电信增值 + * @return string copyright_info - 版权信息 + * @return string official_website_logo - 官网LOGO */ public function infoList() { @@ -575,6 +582,13 @@ public function infoList() * @param string enterprise_mailbox - 企业邮箱 required * @param string enterprise_qrcode - 企业二维码 required * @param string online_customer_service_link - 在线客服链接 required + * @param string icp_info - ICP信息 required + * @param string icp_info_link - ICP信息信息链接 required + * @param string public_security_network_preparation - 公安网备 required + * @param string public_security_network_preparation_link - 公安网备链接 required + * @param string telecom_appreciation - 电信增值 required + * @param string copyright_info - 版权信息 required + * @param string official_website_logo - 官网LOGO required */ public function infoUpdate() { diff --git a/10.2.2/app/admin/controller/ConsultController.php b/10.2.5/app/admin/controller/ConsultController.php similarity index 100% rename from 10.2.2/app/admin/controller/ConsultController.php rename to 10.2.5/app/admin/controller/ConsultController.php diff --git a/10.2.2/app/admin/controller/FeedbackController.php b/10.2.5/app/admin/controller/FeedbackController.php similarity index 100% rename from 10.2.2/app/admin/controller/FeedbackController.php rename to 10.2.5/app/admin/controller/FeedbackController.php diff --git a/10.2.2/app/admin/controller/FriendlyLinkController.php b/10.2.5/app/admin/controller/FriendlyLinkController.php similarity index 100% rename from 10.2.2/app/admin/controller/FriendlyLinkController.php rename to 10.2.5/app/admin/controller/FriendlyLinkController.php diff --git a/10.2.2/app/admin/controller/HonorController.php b/10.2.5/app/admin/controller/HonorController.php similarity index 100% rename from 10.2.2/app/admin/controller/HonorController.php rename to 10.2.5/app/admin/controller/HonorController.php diff --git a/10.2.2/app/admin/controller/HostController.php b/10.2.5/app/admin/controller/HostController.php similarity index 98% rename from 10.2.2/app/admin/controller/HostController.php rename to 10.2.5/app/admin/controller/HostController.php index c3490edc..45c84626 100644 --- a/10.2.2/app/admin/controller/HostController.php +++ b/10.2.5/app/admin/controller/HostController.php @@ -26,8 +26,11 @@ public function initialize() * @url /admin/v1/host * @method GET * @param string keywords - 关键字,搜索范围:产品ID,商品名称,标识,用户名,邮箱,手机号 + * @param string billing_cycle - 付款周期 * @param int client_id - 用户ID * @param string status - 状态Unpaid未付款Pending开通中Active已开通Suspended已暂停Deleted已删除Failed开通失败 + * @param int start_time - 开始时间 + * @param int end_time - 结束时间 * @param int page - 页数 * @param int limit - 每页条数 * @param string orderby - 排序 id,active_time,due_time diff --git a/10.2.2/app/admin/controller/IndexController.php b/10.2.5/app/admin/controller/IndexController.php similarity index 100% rename from 10.2.2/app/admin/controller/IndexController.php rename to 10.2.5/app/admin/controller/IndexController.php diff --git a/10.2.2/app/admin/controller/LogController.php b/10.2.5/app/admin/controller/LogController.php similarity index 100% rename from 10.2.2/app/admin/controller/LogController.php rename to 10.2.5/app/admin/controller/LogController.php diff --git a/10.2.2/app/admin/controller/MenuController.php b/10.2.5/app/admin/controller/MenuController.php similarity index 100% rename from 10.2.2/app/admin/controller/MenuController.php rename to 10.2.5/app/admin/controller/MenuController.php diff --git a/10.2.2/app/admin/controller/ModuleController.php b/10.2.5/app/admin/controller/ModuleController.php similarity index 100% rename from 10.2.2/app/admin/controller/ModuleController.php rename to 10.2.5/app/admin/controller/ModuleController.php diff --git a/10.2.2/app/admin/controller/NoticeEmailController.php b/10.2.5/app/admin/controller/NoticeEmailController.php similarity index 100% rename from 10.2.2/app/admin/controller/NoticeEmailController.php rename to 10.2.5/app/admin/controller/NoticeEmailController.php diff --git a/10.2.2/app/admin/controller/NoticeSettingController.php b/10.2.5/app/admin/controller/NoticeSettingController.php similarity index 100% rename from 10.2.2/app/admin/controller/NoticeSettingController.php rename to 10.2.5/app/admin/controller/NoticeSettingController.php diff --git a/10.2.2/app/admin/controller/NoticeSmsController.php b/10.2.5/app/admin/controller/NoticeSmsController.php similarity index 100% rename from 10.2.2/app/admin/controller/NoticeSmsController.php rename to 10.2.5/app/admin/controller/NoticeSmsController.php diff --git a/10.2.2/app/admin/controller/OrderController.php b/10.2.5/app/admin/controller/OrderController.php similarity index 98% rename from 10.2.2/app/admin/controller/OrderController.php rename to 10.2.5/app/admin/controller/OrderController.php index 4b4791a5..bdf10a06 100644 --- a/10.2.2/app/admin/controller/OrderController.php +++ b/10.2.5/app/admin/controller/OrderController.php @@ -18,21 +18,6 @@ public function initialize() $this->validate = new OrderValidate(); } - public function test() - { - // 实例化模型类 - $OrderModel = new OrderModel(); - - // 获取订单列表 - $data = $OrderModel->test(); - - $result = [ - 'status' => 200, - 'msg' => lang('success_message'), - ]; - return json($result); - } - /** * 时间 2022-05-17 * @title 订单列表 @@ -41,10 +26,14 @@ public function test() * @version v1 * @url /admin/v1/order * @method GET - * @param string keywords - 关键字,搜索范围:订单ID,用户名称,邮箱,手机号 + * @param string keywords - 关键字,搜索范围:订单ID,商品名称,用户名称,邮箱,手机号 * @param int client_id - 用户ID * @param string type - 类型new新订单renew续费订单upgrade升降级订单artificial人工订单 * @param string status - 状态Unpaid未付款Paid已付款 + * @param string amount - 金额 + * @param string gateway - 支付方式 + * @param int start_time - 开始时间 + * @param int end_time - 结束时间 * @param int page - 页数 * @param int limit - 每页条数 * @param string orderby - 排序 id @@ -112,6 +101,8 @@ public function orderList() * @return string order.refund_amount - 订单已退款金额 * @return string order.refundable_amount - 订单可退款金额 * @return string order.apply_credit_amount - 订单可应用余额金额 + * @return int order.admin_id - 管理员ID + * @return string order.admin_name - 管理员名称 * @return array order.items - 订单子项 * @return int order.items[].id - 订单子项ID * @return string order.items[].description - 描述 diff --git a/10.2.2/app/admin/controller/PartnerController.php b/10.2.5/app/admin/controller/PartnerController.php similarity index 100% rename from 10.2.2/app/admin/controller/PartnerController.php rename to 10.2.5/app/admin/controller/PartnerController.php diff --git a/10.2.2/app/admin/controller/PluginController.php b/10.2.5/app/admin/controller/PluginController.php similarity index 100% rename from 10.2.2/app/admin/controller/PluginController.php rename to 10.2.5/app/admin/controller/PluginController.php diff --git a/10.2.2/app/admin/controller/ProductController.php b/10.2.5/app/admin/controller/ProductController.php similarity index 100% rename from 10.2.2/app/admin/controller/ProductController.php rename to 10.2.5/app/admin/controller/ProductController.php diff --git a/10.2.2/app/admin/controller/ProductGroupController.php b/10.2.5/app/admin/controller/ProductGroupController.php similarity index 100% rename from 10.2.2/app/admin/controller/ProductGroupController.php rename to 10.2.5/app/admin/controller/ProductGroupController.php diff --git a/10.2.2/app/admin/controller/PublicController.php b/10.2.5/app/admin/controller/PublicController.php similarity index 100% rename from 10.2.2/app/admin/controller/PublicController.php rename to 10.2.5/app/admin/controller/PublicController.php diff --git a/10.2.2/app/admin/controller/ServerController.php b/10.2.5/app/admin/controller/ServerController.php similarity index 98% rename from 10.2.2/app/admin/controller/ServerController.php rename to 10.2.5/app/admin/controller/ServerController.php index 79226355..d8612348 100644 --- a/10.2.2/app/admin/controller/ServerController.php +++ b/10.2.5/app/admin/controller/ServerController.php @@ -26,6 +26,7 @@ public function initialize() * @author hh * @version v1 * @param string keywords - 关键字,搜索接口ID/接口名称/分组名称 + * @param string status - 状态0禁用,1启用 * @param int page - 页数 * @param int limit - 每页条数 * @param string orderby - 排序 id,name,server_group_id,status diff --git a/10.2.2/app/admin/controller/ServerGroupController.php b/10.2.5/app/admin/controller/ServerGroupController.php similarity index 100% rename from 10.2.2/app/admin/controller/ServerGroupController.php rename to 10.2.5/app/admin/controller/ServerGroupController.php diff --git a/10.2.2/app/admin/controller/SupplierController.php b/10.2.5/app/admin/controller/SupplierController.php similarity index 93% rename from 10.2.2/app/admin/controller/SupplierController.php rename to 10.2.5/app/admin/controller/SupplierController.php index 03775f49..9ccb416e 100644 --- a/10.2.2/app/admin/controller/SupplierController.php +++ b/10.2.5/app/admin/controller/SupplierController.php @@ -32,6 +32,7 @@ public function initialize() * @param string sort - 升/降序 asc,desc * @return array list - 供应商 * @return int list[].id - 供应商ID + * @return string list[].type - 供应商类型default默认业务系统whmcs财务系统 * @return string list[].name - 供应商名称 * @return string list[].url - 链接地址 * @return int list[].host_num - 产品数量 @@ -68,6 +69,7 @@ public function list() * @param int id - 供应商ID required * @return object supplier - 供应商 * @return int supplier.id - 供应商ID + * @return string supplier.type - 供应商类型default默认业务系统whmcs财务系统 * @return string supplier.name - 名称 * @return string supplier.url - 链接地址 * @return string supplier.username - 用户名 @@ -105,6 +107,7 @@ public function index() * @version v1 * @url /admin/v1/supplier * @method POST + * @param string type - 供应商类型default默认业务系统whmcs财务系统 required * @param string name - 名称 required * @param string url - 链接地址 required * @param string username - 用户名 required @@ -117,6 +120,7 @@ public function create() { // 接收参数 $param = $this->request->param(); + $param['type'] = $param['type'] ?? 'default'; // 参数验证 if (!$this->validate->scene('create')->check($param)){ @@ -141,6 +145,7 @@ public function create() * @url /admin/v1/supplier/:id * @method PUT * @param int id - 供应商ID required + * @param string type - 供应商类型default默认业务系统whmcs财务系统 required * @param string name - 名称 required * @param string url - 链接地址 required * @param string username - 用户名 required @@ -153,6 +158,7 @@ public function update() { // 接收参数 $param = $this->request->param(); + $param['type'] = $param['type'] ?? 'default'; // 参数验证 if (!$this->validate->scene('update')->check($param)){ diff --git a/10.2.2/app/admin/controller/TaskController.php b/10.2.5/app/admin/controller/TaskController.php similarity index 96% rename from 10.2.2/app/admin/controller/TaskController.php rename to 10.2.5/app/admin/controller/TaskController.php index b2f9c39b..c5aa4b55 100644 --- a/10.2.2/app/admin/controller/TaskController.php +++ b/10.2.5/app/admin/controller/TaskController.php @@ -20,6 +20,8 @@ class TaskController extends AdminBaseController * @method GET * @param string keywords - 关键字,搜索范围:任务ID,描述 * @param string status - 状态Wait未开始Exec执行中Finish完成Failed失败 + * @param int start_time - 开始时间 + * @param int end_time - 结束时间 * @param int page - 页数 * @param int limit - 每页条数 * @param string orderby - 排序 id,description,status,start_time,finish_time diff --git a/10.2.2/app/admin/controller/TransactionController.php b/10.2.5/app/admin/controller/TransactionController.php similarity index 97% rename from 10.2.2/app/admin/controller/TransactionController.php rename to 10.2.5/app/admin/controller/TransactionController.php index f06f7ceb..84d92cf7 100644 --- a/10.2.2/app/admin/controller/TransactionController.php +++ b/10.2.5/app/admin/controller/TransactionController.php @@ -28,7 +28,10 @@ public function initialize() * @param string keywords - 关键字,搜索范围:交易流水号,订单ID,用户名称,邮箱,手机号 * @param int client_id - 用户ID * @param int order_id - 订单ID + * @param string amount - 金额 * @param string gateway - 支付方式 + * @param int start_time - 开始时间 + * @param int end_time - 结束时间 * @param int page - 页数 * @param int limit - 每页条数 * @param string orderby - 排序 id diff --git a/10.2.2/app/admin/controller/UpgradeSystemController.php b/10.2.5/app/admin/controller/UpgradeSystemController.php similarity index 100% rename from 10.2.2/app/admin/controller/UpgradeSystemController.php rename to 10.2.5/app/admin/controller/UpgradeSystemController.php diff --git a/10.2.2/app/admin/controller/UpstreamHostController.php b/10.2.5/app/admin/controller/UpstreamHostController.php similarity index 100% rename from 10.2.2/app/admin/controller/UpstreamHostController.php rename to 10.2.5/app/admin/controller/UpstreamHostController.php diff --git a/10.2.2/app/admin/controller/UpstreamOrderController.php b/10.2.5/app/admin/controller/UpstreamOrderController.php similarity index 100% rename from 10.2.2/app/admin/controller/UpstreamOrderController.php rename to 10.2.5/app/admin/controller/UpstreamOrderController.php diff --git a/10.2.2/app/admin/controller/UpstreamProductController.php b/10.2.5/app/admin/controller/UpstreamProductController.php similarity index 100% rename from 10.2.2/app/admin/controller/UpstreamProductController.php rename to 10.2.5/app/admin/controller/UpstreamProductController.php diff --git a/10.2.2/app/admin/controller/ViewController.php b/10.2.5/app/admin/controller/ViewController.php similarity index 100% rename from 10.2.2/app/admin/controller/ViewController.php rename to 10.2.5/app/admin/controller/ViewController.php diff --git a/10.2.2/app/admin/model/AdminLoginModel.php b/10.2.5/app/admin/model/AdminLoginModel.php similarity index 100% rename from 10.2.2/app/admin/model/AdminLoginModel.php rename to 10.2.5/app/admin/model/AdminLoginModel.php diff --git a/10.2.2/app/admin/model/AdminModel.php b/10.2.5/app/admin/model/AdminModel.php similarity index 98% rename from 10.2.2/app/admin/model/AdminModel.php rename to 10.2.5/app/admin/model/AdminModel.php index 5149d589..ae7ea77c 100644 --- a/10.2.2/app/admin/model/AdminModel.php +++ b/10.2.5/app/admin/model/AdminModel.php @@ -37,7 +37,8 @@ class AdminModel extends Model * @desc 管理员列表 * @author wyh * @version v1 - * @param string keywords - 关键字 + * @param string keywords - 关键字:ID,名称,用户名,邮箱 + * @param string status - 状态0:禁用,1:正常 * @param int page - 页数 * @param int limit - 每页条数 * @param string orderby - 排序 id,nickname,name,email @@ -61,10 +62,15 @@ public function adminList($param) $param['orderby'] = 'a.'.$param['orderby']; } + $param['status'] = $param['status'] ?? ''; + $where = function (Query $query) use($param) { if(!empty($param['keywords'])){ $query->where('a.id|a.nickname|a.name|a.email', 'like', "%{$param['keywords']}%"); } + if(in_array($param['status'], ['0', '1'])){ + $query->where('a.status', $param['status']); + } }; $admins = $this->alias('a') @@ -631,7 +637,7 @@ public function onlineAdminList($param) $day = floor($visitTime/(24*3600)); $visitTime = $visitTime%(24*3600); $hour = floor($visitTime/3600); - $visitTime = $visitTime%60; + $visitTime = $visitTime%3600; $minute = floor($visitTime/60); $value = ($day>0 ? $day.lang('day') : '').($hour>0 ? $hour.lang('hour') : '').($minute>0 ? $minute.lang('minute') : ''); $value = !empty($value) ? $value.lang('ago') : $minute.lang('minute').lang('ago'); diff --git a/10.2.2/app/admin/model/AdminRoleLinkModel.php b/10.2.5/app/admin/model/AdminRoleLinkModel.php similarity index 100% rename from 10.2.2/app/admin/model/AdminRoleLinkModel.php rename to 10.2.5/app/admin/model/AdminRoleLinkModel.php diff --git a/10.2.2/app/admin/model/AdminRoleModel.php b/10.2.5/app/admin/model/AdminRoleModel.php similarity index 100% rename from 10.2.2/app/admin/model/AdminRoleModel.php rename to 10.2.5/app/admin/model/AdminRoleModel.php diff --git a/10.2.2/app/admin/model/AuthLinkModel.php b/10.2.5/app/admin/model/AuthLinkModel.php similarity index 100% rename from 10.2.2/app/admin/model/AuthLinkModel.php rename to 10.2.5/app/admin/model/AuthLinkModel.php diff --git a/10.2.2/app/admin/model/AuthModel.php b/10.2.5/app/admin/model/AuthModel.php similarity index 100% rename from 10.2.2/app/admin/model/AuthModel.php rename to 10.2.5/app/admin/model/AuthModel.php diff --git a/10.2.2/app/admin/model/AuthRuleLinkModel.php b/10.2.5/app/admin/model/AuthRuleLinkModel.php similarity index 100% rename from 10.2.2/app/admin/model/AuthRuleLinkModel.php rename to 10.2.5/app/admin/model/AuthRuleLinkModel.php diff --git a/10.2.2/app/admin/model/AuthRuleModel.php b/10.2.5/app/admin/model/AuthRuleModel.php similarity index 100% rename from 10.2.2/app/admin/model/AuthRuleModel.php rename to 10.2.5/app/admin/model/AuthRuleModel.php diff --git a/10.2.2/app/admin/model/EmailLogModel.php b/10.2.5/app/admin/model/EmailLogModel.php similarity index 100% rename from 10.2.2/app/admin/model/EmailLogModel.php rename to 10.2.5/app/admin/model/EmailLogModel.php diff --git a/10.2.2/app/admin/model/PluginHookModel.php b/10.2.5/app/admin/model/PluginHookModel.php similarity index 100% rename from 10.2.2/app/admin/model/PluginHookModel.php rename to 10.2.5/app/admin/model/PluginHookModel.php diff --git a/10.2.2/app/admin/model/PluginModel.php b/10.2.5/app/admin/model/PluginModel.php similarity index 99% rename from 10.2.2/app/admin/model/PluginModel.php rename to 10.2.5/app/admin/model/PluginModel.php index dbf0ce55..98760630 100644 --- a/10.2.2/app/admin/model/PluginModel.php +++ b/10.2.5/app/admin/model/PluginModel.php @@ -126,10 +126,10 @@ public function pluginList($param) }elseif ($module=='certification'){ $methods = get_class_methods($class)?:[]; $type = []; - if (in_array('IdcsmartaliPerson',$methods)){ + if (in_array("{$kk}Person",$methods)){ $type[] = lang('personal'); } - if (in_array('IdcsmartaliCompany',$methods)){ + if (in_array("{$kk}Company",$methods)){ $type[] = lang('company'); } $vv['certification_type'] = !empty($type)?implode('/',$type):''; diff --git a/10.2.2/app/admin/model/SmsLogModel.php b/10.2.5/app/admin/model/SmsLogModel.php similarity index 100% rename from 10.2.2/app/admin/model/SmsLogModel.php rename to 10.2.5/app/admin/model/SmsLogModel.php diff --git a/10.2.2/app/admin/validate/AdminRoleValidate.php b/10.2.5/app/admin/validate/AdminRoleValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/AdminRoleValidate.php rename to 10.2.5/app/admin/validate/AdminRoleValidate.php diff --git a/10.2.2/app/admin/validate/AdminValidate.php b/10.2.5/app/admin/validate/AdminValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/AdminValidate.php rename to 10.2.5/app/admin/validate/AdminValidate.php diff --git a/10.2.2/app/admin/validate/ClientCreditValidate.php b/10.2.5/app/admin/validate/ClientCreditValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/ClientCreditValidate.php rename to 10.2.5/app/admin/validate/ClientCreditValidate.php diff --git a/10.2.5/app/admin/validate/ClientRecordValidate.php b/10.2.5/app/admin/validate/ClientRecordValidate.php new file mode 100644 index 00000000..c78ba120 --- /dev/null +++ b/10.2.5/app/admin/validate/ClientRecordValidate.php @@ -0,0 +1,31 @@ + 'require|integer|gt:0', + 'content' => 'requireWithout:attachment|max:300', + 'attachment' => 'requireWithout:content|array', + ]; + + protected $message = [ + 'id.require' => 'id_error', + 'id.integer' => 'id_error', + 'id.gt' => 'id_error', + 'content.requireWithout' => 'client_record_content_cannot_empty', + 'content.max' => 'client_record_content_cannot_exceed_300_chars', + 'attachment.requireWithout' => 'client_record_attachment_cannot_empty', + 'attachment.array' => 'param_error', + ]; + + protected $scene = [ + 'create' => ['id', 'content', 'attachment'], + 'update' => ['id', 'content', 'attachment'], + ]; +} \ No newline at end of file diff --git a/10.2.2/app/admin/validate/ClientValidate.php b/10.2.5/app/admin/validate/ClientValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/ClientValidate.php rename to 10.2.5/app/admin/validate/ClientValidate.php diff --git a/10.2.2/app/admin/validate/ConfigurationValidate.php b/10.2.5/app/admin/validate/ConfigurationValidate.php similarity index 87% rename from 10.2.2/app/admin/validate/ConfigurationValidate.php rename to 10.2.5/app/admin/validate/ConfigurationValidate.php index f128b869..06066269 100644 --- a/10.2.2/app/admin/validate/ConfigurationValidate.php +++ b/10.2.5/app/admin/validate/ConfigurationValidate.php @@ -86,7 +86,13 @@ class ConfigurationValidate extends Validate 'enterprise_mailbox' => 'require|max:255', 'enterprise_qrcode' => 'require', 'online_customer_service_link' => 'require', - + 'icp_info' => 'require|max:255', + 'icp_info_link' => 'require|max:255|url', + 'public_security_network_preparation' => 'require|max:255', + 'public_security_network_preparation_link' => 'require|max:255|url', + 'telecom_appreciation' => 'require|max:255', + 'copyright_info' => 'require|max:255', + 'official_website_logo' => 'require', ]; protected $message = [ @@ -194,7 +200,7 @@ class ConfigurationValidate extends Validate 'certification_update_client_phone.require' => 'configuration_certification_update_client_phone_require', 'certification_uncertified_suspended_host.require' => 'configuration_certification_uncertified_suspended_host_require', - # 实名设置 + # 信息设置 'put_on_record.require' => 'put_on_record_require', 'put_on_record.max' => 'put_on_record_max', 'enterprise_name.require' => 'enterprise_name_require', @@ -205,6 +211,21 @@ class ConfigurationValidate extends Validate 'enterprise_mailbox.max' => 'enterprise_mailbox_max', 'enterprise_qrcode.require' => 'enterprise_qrcode_require', 'online_customer_service_link.require' => 'online_customer_service_link_require', + 'icp_info.require' => 'icp_info_require', + 'icp_info.max' => 'icp_info_max', + 'icp_info_link.require' => 'icp_info_link_require', + 'icp_info_link.max' => 'icp_info_link_max', + 'icp_info_link.url' => 'icp_info_link_error', + 'public_security_network_preparation.require' => 'public_security_network_preparation_require', + 'public_security_network_preparation.max' => 'public_security_network_preparation_max', + 'public_security_network_preparation_link.require' => 'public_security_network_preparation_link_require', + 'public_security_network_preparation_link.max' => 'public_security_network_preparation_link_max', + 'public_security_network_preparation_link.url' => 'public_security_network_preparation_link_error', + 'telecom_appreciation.require' => 'telecom_appreciation_require', + 'telecom_appreciation.max' => 'telecom_appreciation_max', + 'copyright_info.require' => 'copyright_info_require', + 'copyright_info.max' => 'copyright_info_max', + 'official_website_logo.require' => 'official_website_logo_require', ]; protected $scene = [ 'system_update' => ['lang_admin','lang_home_open','lang_home','maintenance_mode','website_name','website_url','terms_service_url','terms_privacy_url'], @@ -251,6 +272,13 @@ class ConfigurationValidate extends Validate 'enterprise_mailbox', 'enterprise_qrcode', 'online_customer_service_link', + 'icp_info', + 'icp_info_link', + 'public_security_network_preparation', + 'public_security_network_preparation_link', + 'telecom_appreciation', + 'copyright_info', + 'official_website_logo', ], ]; } \ No newline at end of file diff --git a/10.2.2/app/admin/validate/FeedbackTypeValidate.php b/10.2.5/app/admin/validate/FeedbackTypeValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/FeedbackTypeValidate.php rename to 10.2.5/app/admin/validate/FeedbackTypeValidate.php diff --git a/10.2.2/app/admin/validate/FriendlyLinkValidate.php b/10.2.5/app/admin/validate/FriendlyLinkValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/FriendlyLinkValidate.php rename to 10.2.5/app/admin/validate/FriendlyLinkValidate.php diff --git a/10.2.2/app/admin/validate/HonorValidate.php b/10.2.5/app/admin/validate/HonorValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/HonorValidate.php rename to 10.2.5/app/admin/validate/HonorValidate.php diff --git a/10.2.2/app/admin/validate/HostValidate.php b/10.2.5/app/admin/validate/HostValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/HostValidate.php rename to 10.2.5/app/admin/validate/HostValidate.php diff --git a/10.2.2/app/admin/validate/MenuValidate.php b/10.2.5/app/admin/validate/MenuValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/MenuValidate.php rename to 10.2.5/app/admin/validate/MenuValidate.php diff --git a/10.2.2/app/admin/validate/NoticeEmailValidate.php b/10.2.5/app/admin/validate/NoticeEmailValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/NoticeEmailValidate.php rename to 10.2.5/app/admin/validate/NoticeEmailValidate.php diff --git a/10.2.2/app/admin/validate/NoticeSettingValidate.php b/10.2.5/app/admin/validate/NoticeSettingValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/NoticeSettingValidate.php rename to 10.2.5/app/admin/validate/NoticeSettingValidate.php diff --git a/10.2.2/app/admin/validate/NoticeSmsValidate.php b/10.2.5/app/admin/validate/NoticeSmsValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/NoticeSmsValidate.php rename to 10.2.5/app/admin/validate/NoticeSmsValidate.php diff --git a/10.2.2/app/admin/validate/OrderValidate.php b/10.2.5/app/admin/validate/OrderValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/OrderValidate.php rename to 10.2.5/app/admin/validate/OrderValidate.php diff --git a/10.2.2/app/admin/validate/PartnerValidate.php b/10.2.5/app/admin/validate/PartnerValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/PartnerValidate.php rename to 10.2.5/app/admin/validate/PartnerValidate.php diff --git a/10.2.2/app/admin/validate/ProductGroupValidate.php b/10.2.5/app/admin/validate/ProductGroupValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/ProductGroupValidate.php rename to 10.2.5/app/admin/validate/ProductGroupValidate.php diff --git a/10.2.2/app/admin/validate/ProductValidate.php b/10.2.5/app/admin/validate/ProductValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/ProductValidate.php rename to 10.2.5/app/admin/validate/ProductValidate.php diff --git a/10.2.2/app/admin/validate/ServerGroupValidate.php b/10.2.5/app/admin/validate/ServerGroupValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/ServerGroupValidate.php rename to 10.2.5/app/admin/validate/ServerGroupValidate.php diff --git a/10.2.2/app/admin/validate/ServerValidate.php b/10.2.5/app/admin/validate/ServerValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/ServerValidate.php rename to 10.2.5/app/admin/validate/ServerValidate.php diff --git a/10.2.2/app/admin/validate/SupplierValidate.php b/10.2.5/app/admin/validate/SupplierValidate.php similarity index 81% rename from 10.2.2/app/admin/validate/SupplierValidate.php rename to 10.2.5/app/admin/validate/SupplierValidate.php index f5ecf0c1..555fe7e5 100644 --- a/10.2.2/app/admin/validate/SupplierValidate.php +++ b/10.2.5/app/admin/validate/SupplierValidate.php @@ -10,6 +10,7 @@ class SupplierValidate extends Validate { protected $rule = [ 'id' => 'require|integer|gt:0', + 'type' => 'require|in:default,whmcs', 'name' => 'require|max:50', 'url' => 'require|max:255|url', 'username' => 'require|max:100', @@ -23,6 +24,8 @@ class SupplierValidate extends Validate 'id.require' => 'id_error', 'id.integer' => 'id_error', 'id.gt' => 'id_error', + 'type.require' => 'param_error', + 'type.in' => 'param_error', 'name.require' => 'please_enter_supplier_name', 'name.max' => 'supplier_name_cannot_exceed_50_chars', 'url.require' => 'please_enter_supplier_url', @@ -38,7 +41,7 @@ class SupplierValidate extends Validate ]; protected $scene = [ - 'create' => ['name', 'url', 'username', 'token', 'secret', 'contact', 'notes'], - 'update' => ['id', 'name', 'url', 'username', 'token', 'secret', 'contact', 'notes'], + 'create' => ['type', 'name', 'url', 'username', 'token', 'secret', 'contact', 'notes'], + 'update' => ['id', 'type', 'name', 'url', 'username', 'token', 'secret', 'contact', 'notes'], ]; } \ No newline at end of file diff --git a/10.2.2/app/admin/validate/TransactionValidate.php b/10.2.5/app/admin/validate/TransactionValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/TransactionValidate.php rename to 10.2.5/app/admin/validate/TransactionValidate.php diff --git a/10.2.2/app/admin/validate/UpstreamProductValidate.php b/10.2.5/app/admin/validate/UpstreamProductValidate.php similarity index 100% rename from 10.2.2/app/admin/validate/UpstreamProductValidate.php rename to 10.2.5/app/admin/validate/UpstreamProductValidate.php diff --git a/10.2.2/app/api/controller/AuthController.php b/10.2.5/app/api/controller/AuthController.php similarity index 78% rename from 10.2.2/app/api/controller/AuthController.php rename to 10.2.5/app/api/controller/AuthController.php index f994ca12..4f89018f 100644 --- a/10.2.2/app/api/controller/AuthController.php +++ b/10.2.5/app/api/controller/AuthController.php @@ -43,4 +43,21 @@ public function auth() return json($result); } + + /** + * 时间 2023-02-16 + * @title API同步信息 + * @desc API同步信息 + * @author wyh + * @version v1 + * @url /api/v1/host/sync + * @method POST + */ + public function hostSync() + { + $param = request()->param(); + + $id = $param['id']; + + } } \ No newline at end of file diff --git a/10.2.2/app/api/controller/HostController.php b/10.2.5/app/api/controller/HostController.php similarity index 100% rename from 10.2.2/app/api/controller/HostController.php rename to 10.2.5/app/api/controller/HostController.php diff --git a/10.2.2/app/api/controller/ProductController.php b/10.2.5/app/api/controller/ProductController.php similarity index 100% rename from 10.2.2/app/api/controller/ProductController.php rename to 10.2.5/app/api/controller/ProductController.php diff --git a/10.2.2/app/command/Cron.php b/10.2.5/app/command/Cron.php similarity index 99% rename from 10.2.2/app/command/Cron.php rename to 10.2.5/app/command/Cron.php index cf9f179a..ec0cf07f 100644 --- a/10.2.2/app/command/Cron.php +++ b/10.2.5/app/command/Cron.php @@ -14,6 +14,7 @@ use app\common\model\SupplierModel; use app\common\model\UpstreamProductModel; use app\common\logic\UpstreamLogic; +use app\common\model\ProductModel; class Cron extends Command { @@ -522,7 +523,8 @@ public function downstreamSyncProduct() $id = $productArr[$value['id']][$v['id']]['id']; $profit_percent = $productArr[$value['id']][$v['id']]['profit_percent']; $price = $v['price'] ?? 0; - $price = bcdiv($price*(100+$profit_percent), 100, 2); + $price = $price*(100+$profit_percent); + $price = bcdiv((string)$price, '100', 2); ProductModel::update([ 'pay_type' => $v['pay_type'] ?? 'recurring_prepayment', 'price' => $price, diff --git a/10.2.2/app/command/Task.php b/10.2.5/app/command/Task.php similarity index 95% rename from 10.2.2/app/command/Task.php rename to 10.2.5/app/command/Task.php index bfb1f39c..47820553 100644 --- a/10.2.2/app/command/Task.php +++ b/10.2.5/app/command/Task.php @@ -53,16 +53,16 @@ public function taskWait(){ Db::startTrans(); try{ + Db::name('task_wait')->where('retry','>',3) + ->whereOr('status','Finish') + ->delete(); # 删除重试次数大于3或者状态已完成的任务 + $task_wait = Db::name('task_wait')->limit(10) - //->lock(true) # 加悲观锁,不允许其它进程访问(supervisor开启5个进程) + ->lock(true) # 加悲观锁,不允许其它进程访问(supervisor开启5个进程) ->whereIn('status',['Wait','Failed']) ->where('retry','<=',3) # 重试次数小于等于3 ->select()->toArray();//取10条数据 - Db::name('task_wait')->where('retry','>',3) - ->whereOr('status','Finish') - ->delete(); # 删除重试次数大于3或者状态已完成的任务 - Db::commit(); }catch(\think\db\exception\PDOException $e){ // file_put_contents(__DIR__.'/task.lock', 0); diff --git a/10.2.2/app/common.php b/10.2.5/app/common.php similarity index 96% rename from 10.2.2/app/common.php rename to 10.2.5/app/common.php index 9d2a221b..bd36902a 100644 --- a/10.2.2/app/common.php +++ b/10.2.5/app/common.php @@ -1499,42 +1499,58 @@ function idcsmart_api_curl($api_id,$path,$data=[],$timeout=30,$request='POST') if ($login['status']!=200){ return $login; } + if($login['data']['supplier']['type']=='whmcs'){ + $header = [ + 'Email: '.$login['data']['supplier']['username'], + 'Password: '.$login['data']['supplier']['token'], + ]; - $header = [ - 'Authorization: Bearer '.$login['data']['jwt'] - ]; - - $apiUrl = $login['data']['url'] . '/' .$path; + $apiUrl = $login['data']['url'] . '/modules/addons/idcsmart_reseller/logic/index.php?action='. $path; - $result = curl($apiUrl,$data,$timeout,$request,$header); - if($result['http_code'] != 200){ - return ['status'=>400, 'msg'=>'网络开小差', 'content'=>$result['content']]; - } - $result = json_decode($result['content'], true); - if(empty($result)){ - $result = ['status'=>400, 'msg'=>'网络开小差', 'content'=>$result['content']]; - } - if ($result['status']==401){ - $login = idcsmart_api_login($api_id, true); - if ($login['status']!=200){ - return $login; + $result = curl($apiUrl,$data,$timeout,$request,$header); + if($result['http_code'] != 200){ + return ['status'=>400, 'msg'=>'网络开小差', 'content'=>$result['content']]; } - + $result = json_decode($result['content'], true); + }else{ $header = [ 'Authorization: Bearer '.$login['data']['jwt'] ]; + + $apiUrl = $login['data']['url'] . '/' .$path; + $result = curl($apiUrl,$data,$timeout,$request,$header); if($result['http_code'] != 200){ return ['status'=>400, 'msg'=>'网络开小差', 'content'=>$result['content']]; } $result = json_decode($result['content'], true); - - if ($result['status']==401){ - $result['status']=400; - $result['msg'] = 'API账号或密码错误'; + if(empty($result)){ + $result = ['status'=>400, 'msg'=>'网络开小差', 'content'=>$result['content']]; } + if ($result['status']==401 || $result['status']==405){ + $login = idcsmart_api_login($api_id, true); + if ($login['status']!=200){ + return $login; + } + + $header = [ + 'Authorization: Bearer '.$login['data']['jwt'] + ]; + $result = curl($apiUrl,$data,$timeout,$request,$header); + if($result['http_code'] != 200){ + return ['status'=>400, 'msg'=>'网络开小差', 'content'=>$result['content']]; + } + $result = json_decode($result['content'], true); + + if ($result['status']==401){ + $result['status']=400; + $result['msg'] = 'API账号或密码错误'; + } + } } + + return $result; } diff --git a/10.2.2/app/common/lib/IdcsmartCache.php b/10.2.5/app/common/lib/IdcsmartCache.php similarity index 100% rename from 10.2.2/app/common/lib/IdcsmartCache.php rename to 10.2.5/app/common/lib/IdcsmartCache.php diff --git a/10.2.2/app/common/lib/Loader.php b/10.2.5/app/common/lib/Loader.php similarity index 100% rename from 10.2.2/app/common/lib/Loader.php rename to 10.2.5/app/common/lib/Loader.php diff --git a/10.2.2/app/common/lib/Plugin.php b/10.2.5/app/common/lib/Plugin.php similarity index 100% rename from 10.2.2/app/common/lib/Plugin.php rename to 10.2.5/app/common/lib/Plugin.php diff --git a/10.2.2/app/common/lib/RedisPool.php b/10.2.5/app/common/lib/RedisPool.php similarity index 100% rename from 10.2.2/app/common/lib/RedisPool.php rename to 10.2.5/app/common/lib/RedisPool.php diff --git a/10.2.2/app/common/logic/EmailLogic.php b/10.2.5/app/common/logic/EmailLogic.php similarity index 99% rename from 10.2.2/app/common/logic/EmailLogic.php rename to 10.2.5/app/common/logic/EmailLogic.php index 5f37d964..811ce44e 100644 --- a/10.2.2/app/common/logic/EmailLogic.php +++ b/10.2.5/app/common/logic/EmailLogic.php @@ -224,7 +224,7 @@ public function send($param) $result_hook = hook('before_email_send', ['param' => $param, 'data' => $data]); // name:动作名称send:true发送false取消发送data:发送数据 $result_hook = array_values(array_filter($result_hook ?? [])); foreach ($result_hook as $key => $value) { - if(isset($value['send']) && $value['send']=='false'){ + if(isset($value['send']) && $value['send']===false){ $send = false; break; } diff --git a/10.2.2/app/common/logic/IndexLogic.php b/10.2.5/app/common/logic/IndexLogic.php similarity index 87% rename from 10.2.2/app/common/logic/IndexLogic.php rename to 10.2.5/app/common/logic/IndexLogic.php index 68fe25f0..7299693f 100644 --- a/10.2.2/app/common/logic/IndexLogic.php +++ b/10.2.5/app/common/logic/IndexLogic.php @@ -28,7 +28,10 @@ public function getIndexSaleInfo() { # 获取今年销售额,截止到昨天 $start = mktime(0,0,0,1,1,date("Y")); - $end = strtotime(date("Y-m-d")); + //$end = strtotime(date("Y-m-d")); + $end = time(); + $datetime = $end-strtotime(date("Y-m-d")); + $thisYearAmount = TransactionModel::where('create_time', '>=', $start)->where('create_time', '<', $end)->sum('amount'); $clients = TransactionModel::alias('t') @@ -54,13 +57,14 @@ public function getIndexSaleInfo() }else{ $end = strtotime(date((date("Y")-1)."-m-d")); } - $prevYearAmount = TransactionModel::where('create_time', '>=', $start)->where('create_time', '<', $end)->sum('amount'); + $prevYearAmount = TransactionModel::where('create_time', '>=', $start)->where('create_time', '<', $end+$datetime)->sum('amount'); $thisYearAmountPercent = $prevYearAmount>0 ? bcmul(($thisYearAmount-$prevYearAmount)/$prevYearAmount, 100, 1) : 100; # 获取本月销售额, 截止到昨天 $start = mktime(0,0,0,date("m"),1,date("Y")); - $end = strtotime(date("Y-m-d")); + //$end = strtotime(date("Y-m-d")); + $end = time(); $thisMonthAmount = TransactionModel::where('create_time', '>=', $start)->where('create_time', '<', $end)->sum('amount'); # 获取上月销售额, 截止到上月的昨天同日期 @@ -76,7 +80,7 @@ public function getIndexSaleInfo() $end = $start+date("d")*24*3600; } - $prevMonthAmount = TransactionModel::where('create_time', '>=', $start)->where('create_time', '<', $end)->sum('amount'); + $prevMonthAmount = TransactionModel::where('create_time', '>=', $start)->where('create_time', '<', $end+$datetime)->sum('amount'); $thisMonthAmountPercent = $prevMonthAmount>0 ? bcmul(($thisMonthAmount-$prevMonthAmount)/$prevMonthAmount, 100, 1) : 100; @@ -85,7 +89,10 @@ public function getIndexSaleInfo() for($i=1;$i<=date("m");$i++){ $start = mktime(0,0,0,$i,1,date("Y")); $end = $start+date("t", $start)*24*3600; - $end = $end > strtotime(date("Y-m-d")) ? strtotime(date("Y-m-d")) : $end; + $end = $end + $datetime; + //$end = $end > strtotime(date("Y-m-d")) ? strtotime(date("Y-m-d")) : $end; + $time = time(); + $end = $end > $time ? $time : $end; $amount = TransactionModel::where('create_time', '>=', $start)->where('create_time', '<', $end)->sum('amount'); $thisYearMonthAmount[] = ['month' => $i, 'amount' => amount_format($amount)]; } diff --git a/10.2.2/app/common/logic/ModuleLogic.php b/10.2.5/app/common/logic/ModuleLogic.php similarity index 100% rename from 10.2.2/app/common/logic/ModuleLogic.php rename to 10.2.5/app/common/logic/ModuleLogic.php diff --git a/10.2.5/app/common/logic/ResModuleLogic.php b/10.2.5/app/common/logic/ResModuleLogic.php new file mode 100644 index 00000000..c6209227 --- /dev/null +++ b/10.2.5/app/common/logic/ResModuleLogic.php @@ -0,0 +1,1526 @@ +upstreamProduct = $upstreamProduct; + } + + /** + * 时间 2022-05-27 + * @title 获取模块列表 + * @desc 获取模块列表 + * @author hh + * @version v1 + * @return string [].name - 模块名称 + * @return string [].display_name - 模块显示名称 + */ + public function getModuleList(): array + { + $modules = []; + if(is_dir($this->path)){ + if($handle = opendir($this->path)){ + while(($file = readdir($handle)) !== false){ + if($file != '.' && $file != '..' && is_dir($this->path . $file) && preg_match('/^[a-z][a-z0-9_]{0,99}$/', $file)){ + if($ImportModule = $this->importModule($file)){ + if(method_exists($ImportModule, 'metaData')){ + $metaData = call_user_func([$ImportModule, 'metaData']); + $modules[] = [ + 'name'=>$file, + 'display_name'=>$metaData['display_name'] ?: $file, + ]; + }else{ + $modules[] = [ + 'name'=>$file, + 'display_name'=>$file, + ]; + } + } + } + } + closedir($handle); + } + } + return $modules; + } + + /** + * 时间 2022-05-27 + * @title 测试连接 + * @desc 测试连接 + * @author hh + * @version v1 + * @param ServerModel ServerModel - 接口模型 + * @return int status - 200=连接成功,400=连接失败 + * @return string msg - 信息 + */ + // public function testConnect(ServerModel $ServerModel): array + // { + // $module = $ServerModel['module']; + // if($ImportModule = $this->importModule($module)){ + // if(method_exists($ImportModule, 'testConnect')){ + // // 获取模块通用参数 + // $res = call_user_func([$ImportModule, 'testConnect'], ['server'=>$ServerModel]); + // $res = $this->formatResult($res, lang('module_test_connect_success'), lang('module_test_connect_fail')); + // }else{ + // $res['status'] = 400; + // $res['msg'] = lang('undefined_test_connect_function'); + // } + // }else{ + // $res['status'] = 400; + // $res['msg'] = lang('module_file_is_not_exist'); + // } + // return $res; + // } + + /** + * 时间 2022-05-16 + * @title 产品开通 + * @desc 产品开通 + * @author hh + * @version v1 + * @param HostModel $HostModel - 产品模型 + * @return array + * @return int status - 状态,200=成功,400=失败 + * @return string msg - 信息 + */ + public function createAccount(HostModel $HostModel): array + { + $id = $HostModel->id; + + $UpstreamHostModel = new UpstreamHostModel(); + $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); + if (empty($upstreamHost)) { + return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; + } + $apiId = $this->upstreamProduct['supplier_id']; + # 检查是否可以登录 + $res = idcsmart_api_login($apiId,true); + if ($res['status']==200){ + if($res['data']['supplier']['type']=='whmcs'){ + $upstreamInfo = json_decode($upstreamHost['upstream_info'],true)??[]; + if (!empty($upstreamInfo['token'])){ + $token = $upstreamInfo['token']; + $url = $upstreamInfo['url']; + }else{ + $token = md5(rand_str(16).time().$id); + $url = configuration('website_url'); //request()->domain() . request()->rootUrl(); 服务器定时任务走cli模式,获取的是本地localhost + + $upstreamHost->save([ + 'upstream_info' => json_encode(['token'=>$token,'url'=>$url]) + ]); + } + $upstream_configoption = json_decode($upstreamHost['upstream_configoption'],true); + $param = [ + 'hostname' => $HostModel['name'], + 'productid' => $this->upstreamProduct['upstream_product_id'], + 'billingcycle' => $upstream_configoption['billingcycle'] ?? '', + 'configoptions' => $upstream_configoption['configoption'] ?? [], + 'downstream_url' => $url, + 'downstream_token' => $token, + 'downstream_id' => $id, + ]; + + $res = idcsmart_api_curl($apiId,'host_addOrder',$param,30,'POST'); + if ($res['status']==200){ + if (!empty($res['data']['hosting_id'])){ + $upstreamHost->save([ + 'upstream_host_id' => $res['data']['hosting_id'] + ]); + } + } + } + elseif($res['data']['supplier']['type']=='finance'){ // 对接老财务 + + $upstreamInfo = json_decode($upstreamHost['upstream_info'],true)??[]; + if (!empty($upstreamInfo['token'])){ + $token = $upstreamInfo['token']; + $url = $upstreamInfo['url']; + }else{ + $token = md5(rand_str(16).time().$id); + $url = configuration('website_url'); //request()->domain() . request()->rootUrl(); 服务器定时任务走cli模式,获取的是本地localhost + $upstreamHost->save([ + 'upstream_info' => json_encode(['token'=>$token,'url'=>$url]) + ]); + } + + $clearCartData = [ + 'downstream_url' => $url, + 'downstream_token' => $token, + 'downstream_id' => $id, + ]; + + $res = idcsmart_api_curl($apiId,'/cart/clear',$clearCartData); + + if ($res['status']==200){ + if (!empty($res['hostid'])){ + $upstreamHost->save([ + 'upstream_host_id' => $res['hostid'] + ]); + } + + if (!empty($res['invoiceid'])){ + $payData = [ + 'invoiceid' => $res['invoiceid'], + 'use_credit' => 1, + 'enough' => 1, + 'downstream_url' => $url, + 'downstream_token' => $token, + 'downstream_id' => $id + ]; + + $res = idcsmart_api_curl($apiId,'/apply_credit',$payData); + + if ($res['status']==1001){ + $res['status'] = 200; + $hostId = $res['data']['hostid'][0]??0; + if ($hostId){ + $upstreamHost->save([ + 'upstream_host_id' => $hostId + ]); + } + }elseif ($res['status']==200){ + $res['status']=400; + } + }else{ + + $upstreamHost['upstream_configoption'] = json_decode($upstreamHost['upstream_configoption'],true); + $cartData = [ + 'pid' => $this->upstreamProduct['upstream_product_id'], + 'billingcycle' => $upstreamHost['upstream_configoption']['billingcycle'] ?? '', + 'host' => $upstreamHost['upstream_configoption']['host'] ?? '', + 'password' => $upstreamHost['upstream_configoption']['password'] ?? '', + 'currencyid' => 1, + 'qty' => 1, + 'configoption' => $upstreamHost['upstream_configoption']['configoption'] ?? [], + 'customfield' => $upstreamHost['upstream_configoption']['customfield'] ?? [], + ]; + $res = idcsmart_api_curl($apiId,'/cart/add_to_shop',$cartData); + if ($res['status']==200){ + $settleCartData = [ + 'downstream_url' => $url, + 'downstream_token' => $token, + 'downstream_id' => $id, + /*'cart_data' => [ + 'configoptions' => $cartData['configoption'] + ]*/ + ]; + $res = idcsmart_api_curl($apiId,'/cart/settle',$settleCartData); + + if ($res['status']==200){ + if (isset($res['data']['hostid'][0]) && !empty($res['data']['hostid'][0])){ + $upstreamHost->save([ + 'upstream_host_id' => $res['data']['hostid'][0] + ]); + } + + $invoiceId = $res['data']['invoiceid']??0; + + $applyCreditData = [ + 'invoiceid' => $invoiceId, + 'use_credit' => 1, + 'enough' => 0, + 'downstream_url' => $url, + 'downstream_token' => $token, + 'downstream_id' => $id + ]; + $res = idcsmart_api_curl($apiId,'/apply_credit',$applyCreditData); + + if ($res['status']==1001){ + $res['status']=200; + if (!empty($res['data']['hostid'][0])){ + $upstreamHost->save([ + 'upstream_host_id' => $res['data']['hostid'][0] + ]); + } + }else{ + $creditLimitData = [ + 'invoiceid' => $invoiceId, + 'use_credit_limit' => 1, + 'enough' => 0, + 'downstream_url' => $url, + 'downstream_token' => $token, + 'downstream_id' => $id, + ]; + $res = idcsmart_api_curl($apiId,'/apply_credit_limit',$creditLimitData); + if ($res['status']==1001){ + $res['status']=200; + if (!empty($res['data']['hostid'][0])){ + $upstreamHost->save([ + 'upstream_host_id' => $res['data']['hostid'][0] + ]); + } + }else{ + $creditNotEnough = [ + 'invoiceid' => $invoiceId, + 'use_credit' => 0 + ]; + $msg = $res['msg']; + $res = idcsmart_api_curl($apiId,'/apply_credit',$creditNotEnough); + if ($res['status']!=200){ + $res = idcsmart_api_curl($apiId,'/apply_credit',$creditNotEnough); + } + $res['status'] = 400; + $res['msg'] = $msg; + + } + } + }elseif ($res['status']==1001){ + $res['status'] = 200; + if (!empty($res['data']['hostid'][0])){ + $upstreamHost->save([ + 'upstream_host_id' => $res['data']['hostid'][0] + ]); + } + } + } + } + } + elseif ($res['status']==400){ + if (!empty($res['hostid']) && $res['domainstatus']=='Active'){ + $upstreamHost->save([ + 'upstream_host_id' => $res['hostid'], + ]); + $HostModel->save([ + 'status' => 'Active' + ]); + } + } + if ($res['status']==400){ + $res['msg'] = '上游:' . $res['msg']; + } + + } + else{ + $upstreamInfo = json_decode($upstreamHost['upstream_info'],true)??[]; + if (!empty($upstreamInfo['token'])){ + $token = $upstreamInfo['token']; + $url = $upstreamInfo['url']; + }else{ + $token = md5(rand_str(16).time().$id); + $url = configuration('website_url'); //request()->domain() . request()->rootUrl(); 服务器定时任务走cli模式,获取的是本地localhost + $upstreamHost->save([ + 'upstream_info' => json_encode(['token'=>$token,'url'=>$url]) + ]); + } + + $clearCartData = [ + 'downstream_url' => $url, + 'downstream_token' => $token, + 'downstream_host_id' => $id, + 'downstream_client_id' => $HostModel['client_id'], + ]; + + $enable = PluginModel::where('name', 'IdcsmartSubAccount')->where('module', 'addon')->where('status',1)->find(); + if(!empty($enable) && class_exists('addon\idcsmart_sub_account\model\IdcsmartSubAccountHostModel')){ + // 是否是子账户 + $IdcsmartSubAccountHostModel = IdcsmartSubAccountHostModel::where('host_id', $id)->find(); + if(!empty($IdcsmartSubAccountHostModel)){ + $IdcsmartSubAccountModel = IdcsmartSubAccountModel::find($IdcsmartSubAccountHostModel['addon_idcsmart_sub_account_id']); + if(!empty($IdcsmartSubAccountModel)){ + $clearCartData['downstream_client_id'] = $IdcsmartSubAccountModel['client_id']; + } + } + } + # 清空购物车(检查是否已下单) + $res = idcsmart_api_curl($apiId,'/console/v1/cart',$clearCartData,30,'DELETE'); + if ($res['status']==200){ + if (isset($res['data']['order_id']) && $res['data']['order_id']){ # 已在上游下单,但未支付 + /*$creditData = [ + 'id' => $res['data']['order_id']??0, + 'use' => 1 + ];*/ + # 使用余额 + //$res = idcsmart_api_curl($apiId,'/console/v1/credit',$creditData,30,'POST'); + //if ($res['status']==200){ + $payData = [ + 'id' => $res['data']['order_id']??0, + 'gateway' => 'credit' + ]; + # 支付 + $res = idcsmart_api_curl($apiId,'/console/v1/pay',$payData,30,'POST'); + //} + }else{ + $cartData = [ + 'product_id' => $this->upstreamProduct['upstream_product_id'], + 'qty' => 1, + 'config_options' => json_decode($upstreamHost['upstream_configoption'],true) + ]; + # 加入购物车 + $res = idcsmart_api_curl($apiId,'/console/v1/cart',$cartData,30,'POST'); + if ($res['status']==200){ + $settleCartData = $clearCartData; + $settleCartData['positions'] = [0]; # 取第一个,只有一个 + $settleCartData['downstream_client_id'] = $clearCartData['downstream_client_id']; + # 结算 + $res = idcsmart_api_curl($apiId,'/console/v1/cart/settle',$settleCartData,30,'POST'); + if ($res['status']==200){ + $upstreamHost->save([ + 'upstream_host_id' => $res['data']['host_ids'][0]??0, + ]); + if ($res['data']['amount']>0){ // 处理需要支付的 + /*$creditData = [ + 'id' => $res['data']['order_id']??0, + 'use' => 1 + ];*/ + # 使用余额 + //$res = idcsmart_api_curl($apiId,'/console/v1/credit',$creditData,30,'POST'); + //if ($res['status']==200){ + $payData = [ + 'id' => $res['data']['order_id']??'', + 'gateway' => 'credit' + ]; + # 支付 + $res = idcsmart_api_curl($apiId,'/console/v1/pay',$payData,30,'POST'); + //} + } + } + } + } + } + } + + } + + return $res; + } + + /** + * 时间 2022-05-16 + * @title 产品暂停 + * @desc 产品暂停 + * @author hh + * @version v1 + * @param HostModel $HostModel - 产品模型 + * @return array + * @return int status - 状态,200=成功,400=失败 + * @return string msg - 信息 + */ + public function suspendAccount(HostModel $HostModel, $param = []): array + { + $id = $HostModel->id; + + $UpstreamHostModel = new UpstreamHostModel(); + $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); + if (empty($upstreamHost)) { + return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; + } + + $apiId = $this->upstreamProduct['supplier_id']; + $supplier = SupplierModel::find($apiId); + if($supplier['type']=='whmcs'){ + $suspendData = [ + 'serviceid' => $upstreamHost['upstream_host_id'], + 'suspendreason' => $param['suspend_reason']??'代理商暂停' + ]; + + $res = idcsmart_api_curl($apiId,"service_suspend",$suspendData,30,'POST'); + }elseif ($supplier['type']=='finance'){ + $suspendData = [ + 'id' => $upstreamHost['upstream_host_id'], + 'func' => 'suspend', + 'reason' => $param['suspend_reason']??'代理商暂停', + 'is_api' => 1 + ]; + $res = idcsmart_api_curl($apiId,"/provision/default",$suspendData,30,'POST'); + } + else{ + $suspendData = [ + 'suspend_type' => $param['suspend_type']??'downstream', + 'suspend_reason' => $param['suspend_reason']??'代理商暂停' + ]; + + $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/module/suspend",$suspendData,30,'POST'); + } + + + return $res; + } + + /** + * 时间 2022-05-16 + * @title 产品解除暂停 + * @desc 产品解除暂停 + * @author hh + * @version v1 + * @param HostModel $HostModel - 产品模型 + * @return array + * @return int status - 状态,200=成功,400=失败 + * @return string msg - 信息 + */ + public function unsuspendAccount(HostModel $HostModel): array + { + $id = $HostModel->id; + + $UpstreamHostModel = new UpstreamHostModel(); + $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); + if (empty($upstreamHost)) { + return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; + } + + $apiId = $this->upstreamProduct['supplier_id']; + $supplier = SupplierModel::find($apiId); + if($supplier['type']=='whmcs'){ + $data = [ + 'serviceid' => $upstreamHost['upstream_host_id'], + ]; + + $res = idcsmart_api_curl($apiId,"service_unsuspend",$data,30,'POST'); + }elseif ($supplier['type']=='finance'){ + $unsuspendData = [ + 'id' => $upstreamHost['upstream_host_id'], + 'func' => 'unsuspend', + 'is_api' => 1 + ]; + + $res = idcsmart_api_curl($apiId,"/provision/default",$unsuspendData,30,'POST'); + } + else{ + $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/module/unsuspend",[],30,'POST'); + } + + return $res; + } + + /** + * 时间 2022-05-16 + * @title 产品删除 + * @desc 产品删除 + * @author hh + * @version v1 + * @param HostModel $HostModel - 产品模型 + * @return array + * @return int status - 状态,200=成功,400=失败 + * @return string msg - 信息 + */ + public function terminateAccount(HostModel $HostModel): array + { + $id = $HostModel->id; + + $UpstreamHostModel = new UpstreamHostModel(); + $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); + if (empty($upstreamHost)) { + return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; + } + + $apiId = $this->upstreamProduct['supplier_id']; + $supplier = SupplierModel::find($apiId); + if($supplier['type']=='whmcs'){ + $data = [ + 'serviceid' => $upstreamHost['upstream_host_id'], + ]; + + $res = idcsmart_api_curl($apiId,"service_terminate",$data,30,'POST'); + }elseif ($supplier['type']=='finance'){ + $terminateData = [ + 'id' => $upstreamHost['upstream_host_id'], + 'type' => 'Immediate', + 'reason' => '代理商删除' + ]; + + $res = idcsmart_api_curl($apiId,"/host/cancel",$terminateData,30,'POST'); + }else{ + // TODO + $terminateData = [ + 'host_id' => $upstreamHost['upstream_host_id'], + 'suspend_reason' => '代理商删除', + 'type' => 'Immediate' + ]; + + $res = idcsmart_api_curl($apiId,"/console/v1/refund",$terminateData,30,'POST'); + } + + return $res; + } + + /** + * 时间 2022-05-16 + * @title 续费订单支付后调用 + * @desc 续费订单支付后调用 + * @author hh + * @version v1 + * @param HostModel $HostModel - 产品模型 + */ + public function renew(HostModel $HostModel) + { + $id = $HostModel['id']; + + $UpstreamHostModel = new UpstreamHostModel(); + $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); + if (empty($upstreamHost)) { + return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; + } + + $apiId = $this->upstreamProduct['supplier_id']; + + $supplier = SupplierModel::find($apiId); + if($supplier['type']=='whmcs'){ + $data = [ + 'hosting_id' => $upstreamHost['upstream_host_id'], + 'billingcycle' => $HostModel['billing_cycle_name']??'' + ]; + + $res = idcsmart_api_curl($apiId,"host_renew",$data,30,'POST'); + } + elseif ($supplier['type']=='finance'){ + $renewData = [ + 'billingcycles' => $HostModel['billing_cycle_name']??'', + 'hostid' => $upstreamHost['upstream_host_id'] + ]; + + $res = idcsmart_api_curl($apiId,"/host/renew",$renewData,30,'POST'); + + if ($res['status']==200){ + $applyCreditData = [ + 'invoiceid' => $res['data']['invoiceid'], + 'use_credit' => 1 + ]; + + $res = idcsmart_api_curl($apiId,"/apply_credit",$applyCreditData,30,'POST'); + if ($res['status']==1001){ + $res['status'] = 200; + }elseif ($res['status']==200){ + $res['status'] = 400; + } + + } + + } + else{ + + $renewData = [ + 'billing_cycle' => $HostModel['billing_cycle_name']??'' + ]; + + $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/renew",$renewData,30,'POST'); + if ($res['status']==200){ + if ($res['code']=='Unpaid'){ # 未支付 + $creditData = [ + 'id' => $res['data']['id']??0, + 'use' => 1 + ]; + # 使用余额 + $res = idcsmart_api_curl($apiId,'/console/v1/credit',$creditData,30,'POST'); + if ($res['status']==200){ + $payData = [ + 'id' => $res['data']['id'], + 'gateway' => 'credit' + ]; + # 支付 + $res = idcsmart_api_curl($apiId,'/console/v1/pay',$payData,30,'POST'); + } + } + unset($res['code']); + } + } + + return $res; + } + + /** + * 时间 2022-05-26 + * @title 升降级配置项完成后调用 + * @desc 升降级配置项完成后调用 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @param mixed params - 自定义参数 + */ + public function changePackage(HostModel $HostModel, $params) + { + if($ImportModule = $this->importModule()){ + if(method_exists($ImportModule, 'changePackage')){ + // 获取模块通用参数 + $moduleParams = $HostModel->getModuleParams(); + $moduleParams['custom'] = $params; + $res = call_user_func([$ImportModule, 'changePackage'], $moduleParams); + } + } + // 不需要返回 + } + + /** + * 时间 2022-06-01 + * @title 升降级商品完成后调用 + * @desc 升降级商品完成后调用 + * @author hh + * @version v1 + * @param HostModel HostModel - 已经关联新商品的产品模型 + * @param mixed params - 自定义参数 + */ + // public function changeProduct(HostModel $HostModel, $params) + // { + // if($ImportModule = $this->importModule()){ + // if(method_exists($ImportModule, 'changeProduct')){ + // // 获取模块通用参数 + // $moduleParams = $HostModel->getModuleParams(); + // $moduleParams['custom'] = $params; + // $res = call_user_func([$ImportModule, 'changeProduct'], $moduleParams); + // } + // } + // // 不需要返回 + // } + + /** + * 时间 2022-05-26 + * @title 购物车价格计算 + * @desc 购物车价格计算 + * @author hh + * @version v1 + * @param ProductModel $ProductModel - 产品模型 + * @param mixed $params [] 自己定义的参数 + * @param string scene - 场景(buy=验证所有参数,cal_price=价格计算) + * @return int status - 状态(200=成功,400=失败) + * @return array data - 购物车数据 + * @return float data.price - 配置项金额 + * @return string data.billing_cycle - 周期名称 + * @return int data.duration - 周期时长 + * @return string data.description - 订单子项描述 + * @return string data.content - 购物车配置显示,支持模板 + * @return string data.preview[].name - 名称 + * @return string data.preview[].value - 值 + * @return string data.preview[].price - 价格 + */ + public function cartCalculatePrice($ProductModel, $params = [], $qty=1) + { + $apiId = $this->upstreamProduct['supplier_id']; + + $supplier = SupplierModel::find($apiId); + if($supplier['type']=='whmcs'){ + if(in_array($ProductModel['pay_type'], ['onetime', 'free'])){ + $params['cycle'] = 'monthly'; + } + $data = [ + 'productid' => $this->upstreamProduct['upstream_product_id'], + 'billingcycle' => $params['cycle']??'monthly', + 'configoptions' => $params['configoption']??'', + ]; + + $res = idcsmart_api_curl($apiId,"product_price",$data,30,'POST'); + + if ($res['status']==200){ + $res['data']['profit'] = bcmul($res['data']['price'] ?? 0, ($this->upstreamProduct['profit_percent']/100), 2); + $res['data']['price'] = bcadd($res['data']['price'] ?? 0, $res['data']['profit'], 2); + $res['data']['renew_price'] = bcmul($res['data']['renew_price']??0,(1+$this->upstreamProduct['profit_percent']/100),2); + $res['data']['base_price'] = bcmul($res['data']['base_price']??0,(1+$this->upstreamProduct['profit_percent']/100),2); + $billingCycleArr = [ + 'monthly' => '月付', + 'quarterly' => '季付', + 'semiannually' => '半年付', + 'annually' => '年付', + 'biennially' => '两年付', + 'triennially' => '三年付', + ]; + $durationArr = [ + 'monthly' => 30*24*3600, + 'quarterly' => 90*24*3600, + 'semiannually' => 180*24*3600, + 'annually' => 365*24*3600, + 'biennially' => 2*365*24*3600, + 'triennially' => 3*365*24*3600, + ]; + + $res['data']['billing_cycle'] = $billingCycleArr[$data['billingcycle']] ?? ''; + $res['data']['duration'] = $durationArr[$data['billingcycle']] ?? 0; + if(in_array($ProductModel['pay_type'], ['onetime', 'free'])){ + $res['data']['renew_price'] = 0; + $res['data']['billing_cycle'] = $ProductModel['pay_type'] == 'onetime' ? '一次性' : '免费'; + $res['data']['duration'] = 0; + } + // TODO + $description = ''; + foreach($res['data']['preview'] as $k=>$v){ + if($v['price']>0){ + $v['price'] = bcmul($v['price'],(1+$this->upstreamProduct['profit_percent']/100),2); + $res['data']['preview'][$k]['price'] = $v['price']; + } + $description .= $v['name'].': '.$v['value'].',价格:'.$v['price']."\r\n"; + } + $res['data']['description'] = $description; + $res['data']['content'] = $description; + } + } + elseif ($supplier['type']=='finance'){ + $getTotalData = [ + 'pid' => $this->upstreamProduct['upstream_product_id'], + 'billingcycle' => $params['cycle']??'', + 'qty' => 1, + 'configoption' => $params['configoption']??'', + ]; + + $res = idcsmart_api_curl($apiId,"/cart/get_total", $getTotalData,30,'POST'); + + if ($res['status']==200){ + $res['data']['profit'] = bcmul($res['products']['total'] ?? 0, ($this->upstreamProduct['profit_percent']/100), 2); + $res['data']['price'] = bcadd($res['products']['total'] ?? 0, $res['data']['profit'], 2); + $res['data']['renew_price'] = bcmul($res['products']['signal_price']??0,(1+$this->upstreamProduct['profit_percent']/100),2); + $res['data']['base_price'] = bcmul($res['products']['product_setup_fee']+$res['products']['product_price'],(1+$this->upstreamProduct['profit_percent']/100),2); + $res['data']['billing_cycle'] = $res['products']['billingcycle_zh']; + $res['data']['duration'] = $res['products']['duration']??0; // 老财务添加数据 + $description = ''; + $alloption = $res['products']['child']??[]; + $preview = []; + foreach ($alloption as $k=>$v){ + $preview[] = [ + 'name' => $v['option_name'], + 'value' => $v['suboption_name'], + 'price' => bcmul($v['suboption_price_total']??0,(1+$this->upstreamProduct['profit_percent']/100),2), + ]; + $description .= $v['option_name'].': '.$v['suboption_name'].',价格:'.(bcmul($v['suboption_price_total']??0,(1+$this->upstreamProduct['profit_percent']/100),2))."\r\n"; + } + $res['data']['preview'] = $preview; + $res['data']['description'] = $description; + $res['data']['content'] = $description; + unset($res['currency'],$res['products'],$res['is_aff']); + } + } + else{ + + $upstreamProductId = $this->upstreamProduct['upstream_product_id']; + + $res = idcsmart_api_curl($apiId,"/console/v1/product/{$upstreamProductId}/config_option", ['config_options'=>$params],30,'POST'); + if ($res['status']==200){ + $res['data']['profit'] = bcmul($res['data']['price'] ?? 0, ($this->upstreamProduct['profit_percent']/100), 2); + $res['data']['price'] = bcadd($res['data']['price'] ?? 0, $res['data']['profit'], 2); + $res['data']['renew_price'] = bcmul($res['data']['renew_price']??0,(1+$this->upstreamProduct['profit_percent']/100),2); + $res['data']['base_price'] = bcmul($res['data']['base_price']??0,(1+$this->upstreamProduct['profit_percent']/100),2); + + $description = ''; + foreach($res['data']['preview'] as $k=>$v){ + if($v['price']>0){ + $v['price'] = bcmul($v['price'],(1+$this->upstreamProduct['profit_percent']/100),2); + $res['data']['preview'][$k]['price'] = $v['price']; + } + $description .= $v['name'].': '.$v['value'].',价格:'.$v['price']."\r\n"; + } + $res['data']['description'] = $description; + $res['data']['content'] = $description; + } + } + return $res; + } + + /** + * 时间 2022-05-16 + * @title 后台商品接口配置输出 + * @desc 后台商品接口配置输出 + * @author hh + * @version v1 + * @param HostModel $HostModel - 产品模型 + * @return string + */ + /*public function serverConfigOption($module, ProductModel $ProductModel) + { + $res = ''; + // 模块调用 + // if($ImportModule = $this->importModule()){ + // if(method_exists($ImportModule, 'serverConfigOption')){ + // // 获取模块通用参数 + // $res = call_user_func([$ImportModule, 'serverConfigOption'], ['product'=>$ProductModel]); + // $res = $this->formatTemplate($res); + // } + // } + return $res; + }*/ + + /** + * 时间 2022-05-16 + * @title 产品列表页内容 + * @desc 产品列表页内容 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @return string + */ + public function hostList($module, $params): string + { + $res = ''; + // 模块调用 + if($ImportModule = $this->importModule($module)){ + if(method_exists($ImportModule, 'hostList')){ + // 获取模块通用参数 + $this->upstreamProduct['res_module'] = $module; + $res = call_user_func([$ImportModule, 'hostList'], $params); + $res = $this->formatTemplate($res); + } + } + return $res; + } + + /** + * 时间 2022-05-16 + * @title 产品前台内页输出 + * @desc 产品前台内页输出 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @return string + */ + public function clientArea(HostModel $HostModel): string + { + $res = ''; + // 模块调用 + // $module = $HostModel->getModule(); + if($ImportModule = $this->importModule()){ + if(method_exists($ImportModule, 'clientArea')){ + // 获取模块通用参数 + $params = $HostModel->getModuleParams(); + $res = call_user_func([$ImportModule, 'clientArea'], $params); + $res = $this->formatTemplate($res); + } + } + return $res; + // $id = $HostModel['id']; + + // $UpstreamHostModel = new UpstreamHostModel(); + // $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); + // if (empty($upstreamHost)) { + // return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; + // } + + // $apiId = $this->upstreamProduct['supplier_id']; + + // $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/view",[],30,'GET'); + + // return $res; + } + + /** + * 时间 2022-05-16 + * @title 产品后台内页输出 + * @desc 产品后台内页输出 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @return string + */ + public function adminArea(HostModel $HostModel): string + { + // $id = $HostModel['id']; + + // $UpstreamHostModel = new UpstreamHostModel(); + // $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); + // if (empty($upstreamHost)) { + // return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; + // } + + // $apiId = $this->upstreamProduct['supplier_id']; + + // $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/view",[],30,'GET'); + $res = ''; + return $res; + } + + /** + * 时间 2022-05-30 + * @title 前台商品配置页面 + * @desc 前台商品配置输出,购物车,单独订购,升降级商品 + * @author hh + * @version v1 + * @param ProductModel ProductModel - 产品模型 + * @return string + */ + public function clientProductConfigOption(ProductModel $ProductModel, $tag = ''): string + { + $res = ''; + if($ImportModule = $this->importModule()){ + if(method_exists($ImportModule, 'clientProductConfigOption')){ + // 获取模块通用参数 + $res = call_user_func([$ImportModule, 'clientProductConfigOption'], ['product'=>$ProductModel, 'tag'=>$tag]); + $res = $this->formatTemplate($res); + } + } + return $res; + // $apiId = $this->upstreamProduct['supplier_id']; + + // $upstreamProductId = $this->upstreamProduct['upstream_product_id']; + + // $res = idcsmart_api_curl($apiId,"/console/v1/product/{$upstreamProductId}/config_option",['tag'=>$tag],30,'GET'); + // if ($res['status']==200){ + // return $res['data']['content']??''; + // } + + // return ''; + } + + /** + * 时间 2022-05-31 + * @title 后台商品配置页面 + * @desc 后台商品配置输出,新建订单,升降级商品 + * @author hh + * @version v1 + * @param ProductModel ProductModel - 产品模型 + * @return string + */ + /*public function adminProductConfigOption(ProductModel $ProductModel, $tag = ''): string + { + $apiId = $this->upstreamProduct['supplier_id']; + + $upstreamProductId = $this->upstreamProduct['upstream_product_id']; + + $res = idcsmart_api_curl($apiId,"/console/v1/product/{$upstreamProductId}/config_option",['tag'=>$tag],30,'GET'); + + return $res; + }*/ + + /** + * 时间 2022-05-31 + * @title 前台产品升降级配置输出 + * @desc 前台产品升降级配置输出 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @return string + */ + /*public function clientChangeConfigOption(HostModel $HostModel): string + { + $res = ''; + if($ImportModule = $this->importModule()){ + if(method_exists($ImportModule, 'clientChangeConfigOption')){ + // 获取模块通用参数 + $params = $HostModel->getModuleParams(); + $res = call_user_func([$ImportModule, 'clientChangeConfigOption'], $params); + $res = $this->formatTemplate($res); + } + } + return $res; + }*/ + + /** + * 时间 2022-05-31 + * @title 后台产品升降级配置输出(暂时未用) + * @desc 后台产品升降级配置输出 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @return string + */ + // public function adminChangeConfigOption(HostModel $HostModel): string + // { + // $res = ''; + // if($ImportModule = $this->importModule()){ + // if(method_exists($ImportModule, 'adminChangeConfigOption')){ + // // 获取模块通用参数 + // $params = $HostModel->getModuleParams(); + // $res = call_user_func([$ImportModule, 'adminChangeConfigOption'], $params); + // $res = $this->formatTemplate($res); + // } + // } + // return $res; + // } + + /** + * 时间 2022-05-31 + * @title 升降级配置项计算价格(暂时未用) + * @desc 升降级配置项计算价格 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @param array params - 产品模型 + * @return array + */ + // public function changeConfigOptionCalculatePrice(HostModel $HostModel, $params): array + // { + // $result = []; + // if($ImportModule = $this->importModule()){ + // if(method_exists($ImportModule, 'changeConfigOptionCalculatePrice')){ + // // 获取模块通用参数 + // $result = call_user_func([$ImportModule, 'changeConfigOptionCalculatePrice'], ['host'=>$HostModel, 'product'=>ProductModel::find($HostModel['product_id']), 'custom'=>$params]); + // // TODO 是否判断返回/格式化 + + // } + // } + // if(empty($result)){ + // $result = [ + // 'status'=>400, + // 'msg'=>lang('module_file_is_not_exist'), + // ]; + // } + // return $result; + // } + + /** + * 时间 2022-05-30 + * @title 在结算之后调用 + * @desc 在结算之后调用,通常是验证参数,并保存参数 + * @author hh + * @version v1 + * @param ProductModel ProductModel - 商品模型 + * @param int hostId - 产品ID + * @param array params - 自定义参数 + */ + public function afterSettle($ProductModel, $hostId, $params): void + { + if($ImportModule = $this->importModule()){ + if(method_exists($ImportModule, 'afterSettle')){ + call_user_func([$ImportModule, 'afterSettle'], ['product'=>$ProductModel, 'host_id'=>$hostId, 'custom'=>$params]); + } + } + } + + /** + * 时间 2022-05-16 + * @title 自定义后台方法 + * @desc 自定义后台方法 + * @author hh + * @version v1 + * @param string module - 模块名称 + * @return mixed params - 自定义参数 + */ + // public function customAdminFunction($module, $params) + // { + // $res = []; + // // 验证模块格式是否正确 + // if(!$this->checkModule($module)){ + // $res['status'] = 400; + // $res['msg'] = '模块格式错误'; + // return json($res); + // } + // $controller = $params['controller'] ?? ''; + // $method = $params['method'] ?? ''; + // if(empty($controller) || empty($method)){ + // $res['status'] = 400; + // $res['msg'] = '模块格式错误'; + // return json($res); + // } + // $controller = parse_name($controller.'_controller', 1); + // $method = parse_name($method, 1, false); + + // $class = '\reserver\\'.$module.'\\controller\\admin\\'.$controller; + // if(class_exists($class)){ + // $class = new $class(); + + // if(method_exists($class, $method)){ + // $res = call_user_func([$class, $method], $params); + // }else{ + // $res['status'] = 400; + // $res['msg'] = '模块或方法不存在'; + // $res = json($res); + // } + // }else{ + // $res['status'] = 400; + // $res['msg'] = '模块或方法不存在'; + // $res = json($res); + // } + // // if($this->importModule($module)){ + // // // 执行模块操作 + // // $func = $module . '_CustomAdminFunction'; + // // if(function_exists($func)){ + // // $res = call_user_func($func, $params); + // // $res = $this->formatResult($res); + // // } + // // } + // // if(empty($res)){ + // // $res['status'] = 400; + // // $res['msg'] = '模块或方法不存在'; + // // } + // return $res; + // } + + /** + * 时间 2022-06-08 + * @title 自定义前台方法 + * @desc 自定义前台方法 + * @author hh + * @version v1 + * @param string $module - 模块名称 + * @param mixed $params - POST的其他参数 + * @return array + */ + // public function customClientFunction($module, $params) + // { + // $res = []; + // // 验证模块格式是否正确 + // if(!$this->checkModule($module)){ + // $res['status'] = 400; + // $res['msg'] = '模块格式错误'; + // return json($res); + // } + // $controller = $params['controller'] ?? ''; + // $method = $params['method'] ?? ''; + // if(empty($controller) || empty($method)){ + // $res['status'] = 400; + // $res['msg'] = '模块格式错误'; + // return json($res); + // } + // $controller = parse_name($controller.'_controller', 1); + // $method = parse_name($method, 1, false); + + // $class = '\reserver\\'.$module.'\\controller\\home\\'.$controller; + // if(class_exists($class)){ + // $class = new $class(); + + // if(method_exists($class, $method)){ + // $res = call_user_func([$class, $method], $params); + // }else{ + // $res['status'] = 400; + // $res['msg'] = '模块或方法不存在'; + // $res = json($res); + // } + // }else{ + // $res['status'] = 400; + // $res['msg'] = '模块或方法不存在'; + // $res = json($res); + // } + // return $res; + // } + + /** + * 时间 2022-06-02 + * @title 获取当前产品所有周期价格 + * @desc 获取当前产品所有周期价格 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @return int status - 状态码(200=成功,400=失败) + * @return string msg - 提示信息 + * @return array data - 数据 + * @return float data[].price - 金额 + * @return string data[].billing_cycle - 周期名称 + * @return int data[].duration - 周期时长(秒) + */ + public function durationPrice(HostModel $HostModel) + { + $id = $HostModel['id']; + + $UpstreamHostModel = new UpstreamHostModel(); + $upstreamHost = $UpstreamHostModel->where('host_id', $id)->find(); + if (empty($upstreamHost)) { + return ['status' => 400, 'msg' => lang('upstream_host_is_not_exist')]; + } + + $apiId = $this->upstreamProduct['supplier_id']; + + $supplier = SupplierModel::find($apiId); + + if ($supplier['type']=='finance'){ + + $renewData = [ + 'hostid' => $upstreamHost['upstream_host_id'], + ]; + + $res = idcsmart_api_curl($apiId,"/host/renewpage",$renewData,30,'GET'); + if ($res['status']==200){ + $hosts = []; + $cycles = $res['data']['cycle']??[]; + foreach ($cycles as $cycle){ + $hosts[] = [ + 'duration' => $cycle['duration']??0, + 'price' => bcmul($cycle['amount'], (1+$this->upstreamProduct['profit_percent']/100), 2), + 'billing_cycle' => $cycle['billingcycle'], + ]; + } + + return [ + 'status' => 200, + 'msg' => lang('success_message'), + 'data' => $hosts + ]; + + }else{ + return $res; + } + + }else{ + $res = idcsmart_api_curl($apiId,"/console/v1/host/{$upstreamHost['upstream_host_id']}/renew",[],30,'GET'); + + if ($res['status']==200){ + $result = [ + 'status' => 200, + 'msg' => $res['msg'], + 'data' => [ + ] + ]; + foreach ($res['data']['host'] as $item){ + $item['profit'] = bcmul($item['price'], ($this->upstreamProduct['profit_percent']/100), 2); + $item['price'] = bcadd($item['price'], $item['profit'], 2); + $result['data'][] = $item; + } + return $result; + } + + return $res; + } + + } + + /** + * 时间 2022-06-16 + * @title 获取商品所有配置项 + * @desc 获取商品所有配置项 + * @author hh + * @version v1 + * @param ProductModel ProductModel - 商品模型 + * @return array + */ + public function allConfigOption(ProductModel $ProductModel) + { + $apiId = $this->upstreamProduct['supplier_id']; + + $supplier = SupplierModel::find($apiId); + + $upstreamProductId = $this->upstreamProduct['upstream_product_id']; + + if ($supplier['type']=='finance'){ + $postData = [ + 'pid' => $upstreamProductId, + 'billingcycle' => '' + ]; + $res = idcsmart_api_curl($apiId,"/cart/set_config",$postData,30,'GET'); + if ($res['status']==200){ + $options = $res['option']??[]; + $data = []; + foreach ($options as $option){ + if ($option['option_type']==1){ + $suboptions = $option['sub']??[]; + $subArr = []; + foreach ($suboptions as $suboption){ + $subArr[] = [ + 'name' => $suboption['option_name'], + 'value' => $suboption['id'], + ]; + } + $data[] = [ + 'name' => $option['option_name'], + 'field' => "configoption[{$option['id']}]", + 'type' => 'dropdown', + 'option' => $subArr + ]; + } + } + $res = [ + 'status' => 200, + 'msg' => $res['msg'], + 'data' => $data + ]; + } + } + + return $res??[]; + } + + /** + * 时间 2022-08-04 + * @title 获取当前产品配置项 + * @desc 获取当前产品配置项 + * @author hh + * @version v1 + * @param HostModel HostModel - 产品模型 + * @return int status - 状态码(200=成功,400=失败) + * @return string msg - 提示信息 + * @return array data - 数据 + */ + /*public function currentConfigOption(HostModel $HostModel) + { + $res = []; + if($ImportModule = $this->importModule()){ + if(method_exists($ImportModule, 'currentConfigOption')){ + // 获取模块通用参数 + $moduleParams = $HostModel->getModuleParams(); + $res = call_user_func([$ImportModule, 'currentConfigOption'], $moduleParams); + // TODO 验证返回 + } + } + // if(empty($res)){ + // $res = ['status'=>400, 'msg'=>'module_file_is_not_exist']; + // } + return $res; + }*/ + + /** + * 时间 2023-01-30 + * @title 获取商品最低周期价格 + * @desc 获取商品最低周期价格 + * @author hh + * @version v1 + * @param int productId - 商品ID + * @return float price - 价格 + * @return string cycle - 周期 + * @return ProductModel product - ProductModel实例 + */ + // public function getPriceCycle($productId) + // { + // $res = [ + // 'price' => null, + // 'cycle' => null + // ]; + // $ProductModel = ProductModel::findOrEmpty($productId); + + // $module = $ProductModel->getModule(); + // if($ImportModule = $this->importModule($module)){ + // if(method_exists($ImportModule, 'getPriceCycle')){ + // $moduleRes = call_user_func([$ImportModule, 'getPriceCycle'], ['product'=>$ProductModel]); + // if(isset($moduleRes['price']) && is_numeric($moduleRes['price'])){ + // $res['price'] = $moduleRes['price']; + // } + // if(isset($moduleRes['cycle'])){ + // $res['cycle'] = $moduleRes['cycle']; + // } + // } + // } + // $res['product'] = $ProductModel; + // return $res; + // } + + + public function downloadResource($ProductModel){ + $apiId = $this->upstreamProduct['supplier_id']; + + $res = idcsmart_api_curl($apiId, sprintf('api/v1/product/%d/resource', $this->upstreamProduct['upstream_product_id']), [] ,30, 'GET'); + return $res; + } + + + + + /** + * 时间 2022-06-08 + * @title 验证模块名称是否正确 + * @desc 验证模块名称是否正确 + * @author hh + * @version v1 + * @param string $module - 模块名称 + * @return bool + */ + protected function checkModule($module){ + return (bool)preg_match('/^[a-z][a-z0-9_]{0,99}$/', $module); + } + + /** + * 时间 2022-05-16 + * @title 引入商品模块文件 + * @desc 引入商品模块文件 + * @author hh + * @version v1 + * @param string module - 模块类型 + * @return bool|object - - false=没有对应类,object=成功实例化模块类 + */ + protected function importModule($module = null) + { + $module = $module ?? $this->upstreamProduct['res_module']; + if(!empty($module)){ + $className = parse_name($module, 1); + + $class = '\reserver\\'.$module.'\\'.$className; + + if(class_exists($class)){ + return new $class(); + } + } + return false; + } + + /** + * 时间 2022-05-26 + * @title 格式化文本返回 + * @desc 格式化文本返回 + * @author hh + * @version v1 + * @param string $module 模块名称 + * @param mixed $res 模块返回 + * @return string + */ + private function formatTemplate($res = null): string + { + $html = ''; + $module = $module ?? $this->upstreamProduct['res_module']; + if(is_array($res)){ + // 认为是使用模板的方式来输出内容,格式大概如下 + // [ + // 'template'=>'abc.html', + // 'vars'=>[ + // 'aaaa'=>'bbb' + // ] + // ] + $template_file = $this->path . $module . '/' . $res['template']; + if(file_exists($template_file)){ + $PluginModel=new PluginModel(); + $addons = $PluginModel->plugins('addon')['list']; + + $vars = isset($res['vars']) && !empty($res['vars']) && is_array($res['vars']) ? $res['vars'] : []; + $vars['addons'] = $addons; + + View::assign($vars); + // 调用方法变量 + $html = View::fetch($template_file); + }else{ + $html = lang('module_cannot_find_template_file'); + } + }else if(is_string($res)){ + $html = $res; + }else{ + $html = (string)$res; + } + return $html; + } + + /** + * 时间 2022-05-13 + * @title 格式化系统操作返回 + * @desc 格式化系统操作返回 + * @author hh + * @version v1 + * @param mixed res - 操作返回 required + * @param string successMsg - 成功返回没有提示信息时,会用该信息提示 + * @param string failMsg - 失败返回没有提示信息时,会用该信息提示 + * @return array + */ + private function formatResult($res, $successMsg = '', $failMsg = ''): array + { + $result = []; + // 不兼容原来的老模块写法,都必须按标准返回 + if(is_array($res)){ + $result = $res; + + if($result['status'] === 400){ + $result['msg'] = $result['msg'] ?? ($failMsg ?: lang('module_operate_fail')); + }else if($result['status'] === 200){ + $result['msg'] = $result['msg'] ?? ($successMsg ?: lang('module_operate_success')); + }else{ + $result = []; + $result['status'] = 400; + $result['msg'] = lang('module_res_format_error'); + } + }else{ + $result = []; + $result['status'] = 400; + $result['msg'] = lang('module_res_format_error'); + // 原模块返回判断(废弃) + // if($res === null || $res == 'success' || $res == 'ok'){ + // $result['status'] = 200; + // $result['msg'] = '操作成功'; + // }else{ + // $result['status'] = 400; + // $result['msg'] = (string)$res; + // } + } + return $result; + } + + +} + + + diff --git a/10.2.2/app/common/logic/SmsLogic.php b/10.2.5/app/common/logic/SmsLogic.php similarity index 99% rename from 10.2.2/app/common/logic/SmsLogic.php rename to 10.2.5/app/common/logic/SmsLogic.php index 02e9b375..e325badf 100644 --- a/10.2.2/app/common/logic/SmsLogic.php +++ b/10.2.5/app/common/logic/SmsLogic.php @@ -267,7 +267,7 @@ public function send($param) $result_hook = hook('before_sms_send', ['param' => $param, 'data' => $data]); // name:动作名称send:true发送false取消发送data:发送数据 $result_hook = array_values(array_filter($result_hook ?? [])); foreach ($result_hook as $key => $value) { - if(isset($value['send']) && $value['send']=='false'){ + if(isset($value['send']) && $value['send']===false){ $send = false; break; } @@ -337,6 +337,7 @@ private function smsMethods($cmd,$param) 'mobile' => $param['mobile'], 'content' => $param['content'], 'templateParam' => $param['template_param'], + 'template_id' => $param['template_id']??0, 'config' => $config?:[], ]; return $sms_class->$cmd($data); diff --git a/10.2.2/app/common/logic/UpgradePluginsLogic.php b/10.2.5/app/common/logic/UpgradePluginsLogic.php similarity index 100% rename from 10.2.2/app/common/logic/UpgradePluginsLogic.php rename to 10.2.5/app/common/logic/UpgradePluginsLogic.php diff --git a/10.2.2/app/common/logic/UpgradeSystemLogic.php b/10.2.5/app/common/logic/UpgradeSystemLogic.php similarity index 100% rename from 10.2.2/app/common/logic/UpgradeSystemLogic.php rename to 10.2.5/app/common/logic/UpgradeSystemLogic.php diff --git a/10.2.2/app/common/logic/UploadLogic.php b/10.2.5/app/common/logic/UploadLogic.php similarity index 100% rename from 10.2.2/app/common/logic/UploadLogic.php rename to 10.2.5/app/common/logic/UploadLogic.php diff --git a/10.2.2/app/common/logic/UpstreamLogic.php b/10.2.5/app/common/logic/UpstreamLogic.php similarity index 56% rename from 10.2.2/app/common/logic/UpstreamLogic.php rename to 10.2.5/app/common/logic/UpstreamLogic.php index 189f5230..d358ad95 100644 --- a/10.2.2/app/common/logic/UpstreamLogic.php +++ b/10.2.5/app/common/logic/UpstreamLogic.php @@ -51,7 +51,15 @@ public function recommendProductDetail($param) public function upstreamProductList($param) { - $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/v1/product', [], 30, 'GET'); + if($param['type']=='whmcs'){ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/modules/addons/idcsmart_reseller/logic/index.php?action=product_listing', [], 30, 'POST'); + }elseif ($param['type']=='finance'){ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/product/list', [], 30, 'GET'); + } + else{ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/v1/product', [], 30, 'GET'); + } + return ['list' => $res['data']['list'] ?? []]; } @@ -60,7 +68,15 @@ public function upstreamProductDetail($param) { $param['id'] = $param['id'] ?? 0; - $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/v1/product/'.$param['id'], [], 30, 'GET'); + if($param['type']=='whmcs'){ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/modules/addons/idcsmart_reseller/logic/index.php?action=product_detail', ['productid' => $param['id']], 30, 'POST'); + }elseif ($param['type']=='finance'){ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/product/'.$param['id'], [], 30, 'GET'); + } + else{ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/v1/product/'.$param['id'], [], 30, 'GET'); + } + return ['data' => $res['data']['product'] ?? []]; } @@ -69,42 +85,113 @@ public function upstreamProductDownloadResource($param) { $param['id'] = $param['id'] ?? 0; - $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/v1/product/'.$param['id'].'/resource', [], 30, 'GET'); - $res['data'] = $res['data'] ?? []; - if(!empty($res['data'])){ - if(file_exists(WEB_ROOT."plugins/reserver/".$res['data']['module'].'/'.$res['data']['module'].'_version.txt')){ - $version = file_get_contents(WEB_ROOT."plugins/reserver/".$res['data']['module'].'/'.$res['data']['module'].'_version.txt'); - if(!version_compare($res['data']['version'], $version, '>')){ - return ['status' => 200, 'msg' => lang('success_message'), 'data' => $res['data']]; + if($param['type']=='whmcs'){ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/modules/addons/idcsmart_reseller/logic/index.php?action=product_detail', ['productid' => $param['id']], 30, 'POST'); + $res['data'] = $res['data']['product'] ?? ''; + if(!empty($res['data'])){ + if(file_exists(WEB_ROOT."plugins/reserver/".$res['data']['module'].'/'.$res['data']['module'].'_version.txt')){ + $version = file_get_contents(WEB_ROOT."plugins/reserver/".$res['data']['module'].'/'.$res['data']['module'].'_version.txt'); + if(!version_compare($res['data']['version'], $version, '>')){ + return ['status' => 200, 'msg' => lang('success_message'), 'data' => $res['data']]; + } } + + $dir = WEB_ROOT.'plugins/reserver/'.$res['data']['module'].'.zip'; + $content = $this->curl_download(rtrim($param['url'],'/').'/modules/addons/idcsmart_reseller/'.$res['data']['module'].'.zip', $dir); + if($content){ + $file = WEB_ROOT."plugins/reserver/".$res['data']['module']; + $uuid = $res['data']['module']; + $type = 'reserver'; + $result = $this->unzip($dir,$file); + + if ($result['status'] == 200){ + file_put_contents($file.'/'.$res['data']['module'].'_version.txt', $res['data']['version']); + unlink($dir); + return ['status' => 200, 'msg' => lang('success_message'), 'data' => $res['data']]; + }else{ + return ['status' => 400 , 'msg' => lang('file_unzip_failed', ['{code}' =>$result['msg'], '{file}' => $dir])]; + } + }else{ + return ['status' => 400, 'msg' => lang('resource_download_failed')]; + } + }else{ + return ['status' => 400, 'msg' => lang('upstream_product_resource_get_failed')]; } + }elseif ($param['type']=='finance'){ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/product/'.$param['id'].'/resource', [], 30, 'GET'); + $res['data'] = $res['data'] ?? []; + if(!empty($res['data'])){ + if(file_exists(WEB_ROOT."plugins/reserver/".$res['data']['module'].'/'.$res['data']['module'].'_version.txt')){ + $version = file_get_contents(WEB_ROOT."plugins/reserver/".$res['data']['module'].'/'.$res['data']['module'].'_version.txt'); + if(!version_compare($res['data']['version'], $version, '>')){ + return ['status' => 200, 'msg' => lang('success_message'), 'data' => $res['data']]; + } + } - $dir = WEB_ROOT.'plugins/reserver/'.$res['data']['module'].'.zip'; - $content = $this->curl_download($res['data']['url'], $dir); - if($content){ - $file = WEB_ROOT."plugins/reserver/".$res['data']['module']; - $uuid = $res['data']['module']; - $type = 'reserver'; - $result = $this->unzip($dir,$file); - - if ($result['status'] == 200){ - file_put_contents($file.'/'.$res['data']['module'].'_version.txt', $res['data']['version']); - unlink($dir); - return ['status' => 200, 'msg' => lang('success_message'), 'data' => $res['data']]; + $dir = WEB_ROOT.'plugins/reserver/'.$res['data']['module'].'.zip'; + $content = $this->curl_download($res['data']['url'], $dir); + if($content){ + $file = WEB_ROOT."plugins/reserver/".$res['data']['module']; + $uuid = $res['data']['module']; + $type = 'reserver'; + $result = $this->unzip($dir,$file); + + if ($result['status'] == 200){ + file_put_contents($file.'/'.$res['data']['module'].'_version.txt', $res['data']['version']); + unlink($dir); + return ['status' => 200, 'msg' => lang('success_message'), 'data' => $res['data']]; + }else{ + return ['status' => 400 , 'msg' => lang('file_unzip_failed', ['{code}' =>$result['msg'], '{file}' => $dir])]; + } }else{ - return ['status' => 400 , 'msg' => lang('file_unzip_failed', ['{code}' =>$result['msg'], '{file}' => $dir])]; + return ['status' => 400, 'msg' => lang('resource_download_failed')]; } }else{ - return ['status' => 400, 'msg' => lang('resource_download_failed')]; + return ['status' => 400, 'msg' => lang('upstream_product_resource_get_failed')]; + } + } + else{ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/v1/product/'.$param['id'].'/resource', [], 30, 'GET'); + $res['data'] = $res['data'] ?? []; + if(!empty($res['data'])){ + if(file_exists(WEB_ROOT."plugins/reserver/".$res['data']['module'].'/'.$res['data']['module'].'_version.txt')){ + $version = file_get_contents(WEB_ROOT."plugins/reserver/".$res['data']['module'].'/'.$res['data']['module'].'_version.txt'); + if(!version_compare($res['data']['version'], $version, '>')){ + return ['status' => 200, 'msg' => lang('success_message'), 'data' => $res['data']]; + } + } + + $dir = WEB_ROOT.'plugins/reserver/'.$res['data']['module'].'.zip'; + $content = $this->curl_download($res['data']['url'], $dir); + if($content){ + $file = WEB_ROOT."plugins/reserver/".$res['data']['module']; + $uuid = $res['data']['module']; + $type = 'reserver'; + $result = $this->unzip($dir,$file); + + if ($result['status'] == 200){ + file_put_contents($file.'/'.$res['data']['module'].'_version.txt', $res['data']['version']); + unlink($dir); + return ['status' => 200, 'msg' => lang('success_message'), 'data' => $res['data']]; + }else{ + return ['status' => 400 , 'msg' => lang('file_unzip_failed', ['{code}' =>$result['msg'], '{file}' => $dir])]; + } + }else{ + return ['status' => 400, 'msg' => lang('resource_download_failed')]; + } + }else{ + return ['status' => 400, 'msg' => lang('upstream_product_resource_get_failed')]; } - }else{ - return ['status' => 400, 'msg' => lang('upstream_product_resource_get_failed')]; } } public function upstreamApiAuth($param) { - $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/v1/auth', $param, 30, 'POST'); + if($param['type']=='whmcs'){ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/modules/addons/idcsmart_reseller/logic/index.php?action=product_listing', [], 30, 'POST'); + }else{ + $res = $this->upstreamRequest(rtrim($param['url'],'/').'/api/v1/auth', $param, 30, 'POST'); + } return $res; } diff --git a/10.2.2/app/common/logic/VerificationCodeLogic.php b/10.2.5/app/common/logic/VerificationCodeLogic.php similarity index 100% rename from 10.2.2/app/common/logic/VerificationCodeLogic.php rename to 10.2.5/app/common/logic/VerificationCodeLogic.php diff --git a/10.2.2/app/common/model/ApiModel.php b/10.2.5/app/common/model/ApiModel.php similarity index 98% rename from 10.2.2/app/common/model/ApiModel.php rename to 10.2.5/app/common/model/ApiModel.php index 41adceac..cff1b6d6 100644 --- a/10.2.2/app/common/model/ApiModel.php +++ b/10.2.5/app/common/model/ApiModel.php @@ -67,7 +67,7 @@ public function ApiList($param) } }) ->count(); - $api = $this->field('name,id,token,create_time,status,ip') + $api = $this->field('name,id,token,create_time,status,ip,private_key') ->where(function ($query) use($param) { if(!empty($param['client_id'])){ $query->where('client_id', $param['client_id']); @@ -80,6 +80,7 @@ public function ApiList($param) ->toArray(); foreach ($api as $key => $value) { + var_dump(aes_password_decode($value['private_key']));die; $api[$key]['token'] = hide_str(aes_password_decode($value['token']), '*', 12, 8); // 隐藏token的部分字符 } diff --git a/10.2.2/app/common/model/ClientCreditModel.php b/10.2.5/app/common/model/ClientCreditModel.php similarity index 100% rename from 10.2.2/app/common/model/ClientCreditModel.php rename to 10.2.5/app/common/model/ClientCreditModel.php diff --git a/10.2.2/app/common/model/ClientCustomFieldModel.php b/10.2.5/app/common/model/ClientCustomFieldModel.php similarity index 100% rename from 10.2.2/app/common/model/ClientCustomFieldModel.php rename to 10.2.5/app/common/model/ClientCustomFieldModel.php diff --git a/10.2.2/app/common/model/ClientLoginModel.php b/10.2.5/app/common/model/ClientLoginModel.php similarity index 100% rename from 10.2.2/app/common/model/ClientLoginModel.php rename to 10.2.5/app/common/model/ClientLoginModel.php diff --git a/10.2.2/app/common/model/ClientModel.php b/10.2.5/app/common/model/ClientModel.php similarity index 98% rename from 10.2.2/app/common/model/ClientModel.php rename to 10.2.5/app/common/model/ClientModel.php index c4536b1b..a1f19e2d 100644 --- a/10.2.2/app/common/model/ClientModel.php +++ b/10.2.5/app/common/model/ClientModel.php @@ -175,6 +175,10 @@ public function clientList($param) * @return string login_logs[].ip - IP * @return int login_logs[].login_time - 登录时间 * @return int login_logs[].register_time - 注册时间 + * @return boolean certification 是否实名认证 + * @return object certification_detail 实名认证详情(当certification==true时,才会有此字段) + * @return object certification_detail.company 企业实名认证详情 + * @return object certification_detail.person 个人实名认证详情 */ public function indexClient($id) { @@ -193,7 +197,14 @@ public function indexClient($id) $client['withdraw'] = amount_format(-ClientCreditModel::where('client_id', $id)->where('type', 'Withdraw')->sum('amount')); // 提现 $client['host_num'] = HostModel::where('client_id', $id)->count(); // 产品数量 $client['host_active_num'] = HostModel::where('status', 'Active')->where('client_id', $id)->count(); // 已激活产品数量 - $client['login_logs'] = SystemLogModel::field('ip,create_time login_time')->where('type', 'login')->where('user_type', 'client')->where('user_id', $id)->limit(5)->order('id', 'desc')->select()->toArray(); + $client['login_logs'] = SystemLogModel::field('ip,create_time login_time')->where('type', 'login')->where('user_type', 'client')->where('user_id', $id)->limit(5)->order('id', 'desc')->select()->toArray(); + + $client['certification'] = check_certification($client['id']); + + if ($client['certification']){ + $client['certification_detail'] = hook_one('certification_detail',['client_id'=>$id]); + } + unset($client['client_notes']); }else if($app=='home'){ $client['notes'] = $client['client_notes']; @@ -409,6 +420,12 @@ public function updateClient($param) $description = implode(',', $description); } + $hookRes = hook('before_client_edit',['id'=>$param['id'],'customfield'=>$param['customfield']??[]]); + foreach($hookRes as $v){ + if(isset($v['status']) && $v['status'] == 400){ + return $v; + } + } $this->startTrans(); try { @@ -587,7 +604,7 @@ public function searchClient($param, $type = '') $clients = $this->field('id,username,company,email,phone_code,phone') ->where(function ($query) use($param) { if(!empty($param['keywords'])){ - $query->where('username|company|email|phone', 'like', "%{$param['keywords']}%"); + $query->where('username|company|email|phone|notes|client_notes', 'like', "%{$param['keywords']}%"); } if(!empty($param['client_id'])){ $query->where('id', 'like', $param['client_id']); @@ -2099,14 +2116,16 @@ public function visitClientList($param) $time = time(); foreach ($clients as $key => $value) { $visitTime = $time - $value['last_action_time']; + if($visitTime>365*24*3600){ $clients[$key]['visit_time'] = lang('one_year_ago'); }else{ $day = floor($visitTime/(24*3600)); $visitTime = $visitTime%(24*3600); $hour = floor($visitTime/3600); - $visitTime = $visitTime%60; + $visitTime = $visitTime%3600; $minute = floor($visitTime/60); + $clients[$key]['visit_time'] = ($day>0 ? $day.lang('day') : '').($hour>0 ? $hour.lang('hour') : '').($minute>0 ? $minute.lang('minute') : ''); $clients[$key]['visit_time'] = !empty($clients[$key]['visit_time']) ? $clients[$key]['visit_time'].lang('ago') : $minute.lang('minute').lang('ago'); } diff --git a/10.2.5/app/common/model/ClientRecordModel.php b/10.2.5/app/common/model/ClientRecordModel.php new file mode 100644 index 00000000..1ddb4d63 --- /dev/null +++ b/10.2.5/app/common/model/ClientRecordModel.php @@ -0,0 +1,138 @@ + 'int', + 'client_id' => 'int', + 'admin_id' => 'int', + 'content' => 'string', + 'attachment' => 'string', + 'create_time' => 'int', + 'update_time' => 'int', + ]; + + public function clientRecordList($param) + { + $count = $this->alias('a') + ->field('a.id') + ->count(); + + $url = request()->domain() . '/upload/common/default/'; + + $list = $this->alias('a') + ->field('a.id,a.content,a.attachment,a.admin_id,b.name admin_name,a.create_time') + ->leftjoin('admin b', 'b.id=a.admin_id') + ->where('a.client_id', $param['id']) + ->limit($param['limit']) + ->page($param['page']) + ->order('a.create_time', 'desc') + ->select() + ->toArray(); + foreach ($list as $key => $value) { + $list[$key]['attachment'] = !empty($value['attachment']) ? explode(',', $value['attachment']) : []; + } + + return ['list' => $list, 'count' => $count]; + } + + public function createClientRecord($param) + { + $adminId = get_admin_id(); + + $client = ClientModel::find($param['id']); + if (empty($client)){ + return ['status'=>400, 'msg'=>lang('client_is_not_exist')]; + } + $param['attachment'] = $param['attachment'] ?? []; + foreach ($param['attachment'] as $key => $value) { + if(!file_exists(UPLOAD_DEFAULT.$value)){ + return ['status' => 400, 'msg' => lang('upload_file_is_not_exist')]; + } + } + + $this->startTrans(); + try{ + $this->create([ + 'client_id' => $param['id'], + 'admin_id' => $adminId, + 'content' => $param['content'] ?? '', + 'attachment' => implode(',', $param['attachment']), + 'create_time' => time(), + ]); + + $this->commit(); + }catch (\Exception $e){ + $this->rollback(); + return ['status'=>400, 'msg'=>lang('create_fail')]; + } + + return ['status'=>200, 'msg'=>lang('create_success')]; + } + + public function updateClientRecord($param) + { + $adminId = get_admin_id(); + + $record = $this->find($param['id']); + if (empty($record)){ + return ['status'=>400, 'msg'=>lang('client_record_is_not_exist')]; + } + $param['attachment'] = $param['attachment'] ?? []; + foreach ($param['attachment'] as $key => $value) { + if(!file_exists(UPLOAD_DEFAULT.$value)){ + return ['status' => 400, 'msg' => lang('upload_file_is_not_exist')]; + } + } + + $this->startTrans(); + try{ + $this->update([ + 'admin_id' => $adminId, + 'content' => $param['content'] ?? '', + 'attachment' => implode(',', $param['attachment']), + 'update_time' => time(), + ], ['id' => $param['id']]); + + $this->commit(); + }catch (\Exception $e){ + $this->rollback(); + return ['status'=>400, 'msg'=>lang('update_fail')]; + } + + return ['status'=>200, 'msg'=>lang('update_success')]; + } + + public function deleteClientRecord($id) + { + $record = $this->find($id); + if (empty($record)){ + return ['status'=>400, 'msg'=>lang('client_record_is_not_exist')]; + } + + $this->startTrans(); + try{ + $this->destroy($id); + + $this->commit(); + }catch (\Exception $e){ + $this->rollback(); + return ['status'=>400, 'msg'=>lang('delete_fail')]; + } + + return ['status'=>200, 'msg'=>lang('delete_success')]; + } + +} diff --git a/10.2.2/app/common/model/ConfigOptionModel.php b/10.2.5/app/common/model/ConfigOptionModel.php similarity index 100% rename from 10.2.2/app/common/model/ConfigOptionModel.php rename to 10.2.5/app/common/model/ConfigOptionModel.php diff --git a/10.2.2/app/common/model/ConfigOptionSubModel.php b/10.2.5/app/common/model/ConfigOptionSubModel.php similarity index 100% rename from 10.2.2/app/common/model/ConfigOptionSubModel.php rename to 10.2.5/app/common/model/ConfigOptionSubModel.php diff --git a/10.2.2/app/common/model/ConfigurationModel.php b/10.2.5/app/common/model/ConfigurationModel.php similarity index 97% rename from 10.2.2/app/common/model/ConfigurationModel.php rename to 10.2.5/app/common/model/ConfigurationModel.php index e8f18e30..ee7a5273 100644 --- a/10.2.2/app/common/model/ConfigurationModel.php +++ b/10.2.5/app/common/model/ConfigurationModel.php @@ -100,6 +100,13 @@ class ConfigurationModel extends Model 'enterprise_mailbox', 'enterprise_qrcode', 'online_customer_service_link', + 'icp_info', + 'icp_info_link', + 'public_security_network_preparation', + 'public_security_network_preparation_link', + 'telecom_appreciation', + 'copyright_info', + 'official_website_logo', ], ]; /** @@ -909,6 +916,13 @@ public function certificationUpdate($param) * @return string enterprise_mailbox - 企业邮箱 * @return string enterprise_qrcode - 企业二维码 * @return string online_customer_service_link - 在线客服链接 + * @return string icp_info - ICP信息 + * @return string icp_info_link - ICP信息信息链接 + * @return string public_security_network_preparation - 公安网备 + * @return string public_security_network_preparation_link - 公安网备链接 + * @return string telecom_appreciation - 电信增值 + * @return string copyright_info - 版权信息 + * @return string official_website_logo - 官网LOGO */ public function infoList() { @@ -934,6 +948,13 @@ public function infoList() * @param string enterprise_mailbox - 企业邮箱 required * @param string enterprise_qrcode - 企业二维码 required * @param string online_customer_service_link - 在线客服链接 required + * @param string icp_info - ICP信息 required + * @param string icp_info_link - ICP信息信息链接 required + * @param string public_security_network_preparation - 公安网备 required + * @param string public_security_network_preparation_link - 公安网备链接 required + * @param string telecom_appreciation - 电信增值 required + * @param string copyright_info - 版权信息 required + * @param string official_website_logo - 官网LOGO required */ public function infoUpdate($param) { diff --git a/10.2.2/app/common/model/ConsultModel.php b/10.2.5/app/common/model/ConsultModel.php similarity index 100% rename from 10.2.2/app/common/model/ConsultModel.php rename to 10.2.5/app/common/model/ConsultModel.php diff --git a/10.2.2/app/common/model/CountryModel.php b/10.2.5/app/common/model/CountryModel.php similarity index 100% rename from 10.2.2/app/common/model/CountryModel.php rename to 10.2.5/app/common/model/CountryModel.php diff --git a/10.2.2/app/common/model/EmailTemplateModel.php b/10.2.5/app/common/model/EmailTemplateModel.php similarity index 100% rename from 10.2.2/app/common/model/EmailTemplateModel.php rename to 10.2.5/app/common/model/EmailTemplateModel.php diff --git a/10.2.2/app/common/model/FeedbackModel.php b/10.2.5/app/common/model/FeedbackModel.php similarity index 100% rename from 10.2.2/app/common/model/FeedbackModel.php rename to 10.2.5/app/common/model/FeedbackModel.php diff --git a/10.2.2/app/common/model/FeedbackTypeModel.php b/10.2.5/app/common/model/FeedbackTypeModel.php similarity index 100% rename from 10.2.2/app/common/model/FeedbackTypeModel.php rename to 10.2.5/app/common/model/FeedbackTypeModel.php diff --git a/10.2.2/app/common/model/FriendlyLinkModel.php b/10.2.5/app/common/model/FriendlyLinkModel.php similarity index 100% rename from 10.2.2/app/common/model/FriendlyLinkModel.php rename to 10.2.5/app/common/model/FriendlyLinkModel.php diff --git a/10.2.2/app/common/model/HonorModel.php b/10.2.5/app/common/model/HonorModel.php similarity index 100% rename from 10.2.2/app/common/model/HonorModel.php rename to 10.2.5/app/common/model/HonorModel.php diff --git a/10.2.2/app/common/model/HostModel.php b/10.2.5/app/common/model/HostModel.php similarity index 96% rename from 10.2.2/app/common/model/HostModel.php rename to 10.2.5/app/common/model/HostModel.php index 2974b051..ba2317e1 100644 --- a/10.2.2/app/common/model/HostModel.php +++ b/10.2.5/app/common/model/HostModel.php @@ -2,6 +2,7 @@ namespace app\common\model; use app\common\logic\ResModuleLogic; +use think\db\Query; use think\Model; use think\Db; use app\common\logic\ModuleLogic; @@ -54,8 +55,11 @@ class HostModel extends Model * @author theworld * @version v1 * @param string param.keywords - 关键字,搜索范围:产品ID,商品名称,标识,用户名,邮箱,手机号 + * @param string param.billing_cycle - 付款周期 * @param int param.client_id - 用户ID * @param string param.status - 状态Unpaid未付款Pending开通中Active已开通Suspended已暂停Deleted已删除Failed开通失败 + * @param int param.start_time - 开始时间 + * @param int param.end_time - 结束时间 * @param int param.page - 页数 * @param int param.limit - 每页条数 * @param string param.orderby - 排序 id,active_time,due_time @@ -92,7 +96,10 @@ public function hostList($param) } $param['keywords'] = $param['keywords'] ?? ''; + $param['billing_cycle'] = $param['billing_cycle'] ?? ''; $param['status'] = $param['status'] ?? ''; + $param['start_time'] = intval($param['start_time'] ?? 0); + $param['end_time'] = intval($param['end_time'] ?? 0); $param['orderby'] = isset($param['orderby']) && in_array($param['orderby'], ['id', 'client_id', 'product_name', 'name', 'active_time', 'due_time', 'first_payment_amount', 'status']) ? $param['orderby'] : 'id'; if($param['orderby']=='product_name'){ $param['orderby'] = 'p.name'; @@ -112,58 +119,46 @@ public function hostList($param) } $param['host_id'] = $hostId ?? []; + $where = function (Query $query) use ($param, $app){ + if($app=='home'){ + $query->where('h.status', '<>', 'Cancelled'); + } + if(!empty($param['client_id'])){ + $query->where('h.client_id', (int)$param['client_id']); + } + if(!empty($param['keywords'])){ + $query->where('h.id|p.name|h.name|c.username|c.email|c.phone|h.first_payment_amount', 'like', "%{$param['keywords']}%"); + } + if(!empty($param['billing_cycle'])){ + $query->where('h.billing_cycle_name', 'like', "%{$param['billing_cycle']}%"); + } + if(!empty($param['status'])){ + if($app=='home' && $param['status']=='Pending'){ + $query->whereIn('h.status', ['Pending', 'Failed']); + }else{ + $query->where('h.status', $param['status']); + } + } + if(!empty($param['host_id'])){ + $query->whereIn('h.id', (int)$param['host_id']); + } + if(!empty($param['start_time']) && !empty($param['end_time'])){ + $query->where('h.create_time', '>=', $param['start_time'])->where('h.create_time', '<=', $param['end_time']); + } + }; + $count = $this->alias('h') ->field('h.id') ->leftjoin('product p', 'p.id=h.product_id') ->leftjoin('client c', 'c.id=h.client_id') - ->where(function ($query) use($param, $app) { - if($app=='home'){ - $query->where('h.status', '<>', 'Cancelled'); - } - if(!empty($param['client_id'])){ - $query->where('h.client_id', (int)$param['client_id']); - } - if(!empty($param['keywords'])){ - $query->where('h.id|p.name|h.name|c.username|c.email|c.phone', 'like', "%{$param['keywords']}%"); - } - if(!empty($param['status'])){ - if($app=='home' && $param['status']=='Pending'){ - $query->whereIn('h.status', ['Pending', 'Failed']); - }else{ - $query->where('h.status', $param['status']); - } - } - if(!empty($param['host_id'])){ - $query->whereIn('h.id', (int)$param['host_id']); - } - }) + ->where($where) ->count(); $hosts = $this->alias('h') ->field('h.id,h.client_id,c.username client_name,c.email,c.phone_code,c.phone,c.company,h.product_id,p.name product_name,h.name,h.create_time,h.active_time,h.due_time,h.first_payment_amount,h.billing_cycle,h.billing_cycle_name,h.status,o.pay_time,h.renew_amount') ->leftjoin('product p', 'p.id=h.product_id') ->leftjoin('client c', 'c.id=h.client_id') ->leftjoin('order o', 'o.id=h.order_id') - ->where(function ($query) use($param, $app) { - if($app=='home'){ - $query->where('h.status', '<>', 'Cancelled'); - } - if(!empty($param['client_id'])){ - $query->where('h.client_id', (int)$param['client_id']); - } - if(!empty($param['keywords'])){ - $query->where('h.id|p.name|h.name|c.username|c.email|c.phone', 'like', "%{$param['keywords']}%"); - } - if(!empty($param['status'])){ - if($app=='home' && $param['status']=='Pending'){ - $query->whereIn('h.status', ['Pending', 'Failed']); - }else{ - $query->where('h.status', $param['status']); - } - } - if(!empty($param['host_id'])){ - $query->whereIn('h.id', (int)$param['host_id']); - } - }) + ->where($where) ->limit($param['limit']) ->page($param['page']) ->order($param['orderby'], $param['sort']) @@ -426,7 +421,7 @@ public function updateHost($param) $newProduct = ProductModel::find($param['product_id']); $newProduct = $newProduct['name'] ?? ''; - $description[] = lang('old_to_new',['{old}'=>lang('host_product').$oldProduct, '{new}'=>$param['username']]); + $description[] = lang('old_to_new',['{old}'=>lang('host_product').$oldProduct, '{new}'=>$newProduct]); } if ($host['server_id'] != $param['server_id']){ $oldServer = ServerModel::find($host['server_id']); @@ -455,7 +450,7 @@ public function updateHost($param) $description[] = lang('old_to_new',['{old}'=>lang('host_active_time').date("Y-m-d H:i:s", $host['active_time']), '{new}'=>$param['active_time']]); } if ($host['due_time'] != $param['due_time']){ - $description[] = lang('old_to_new',['{old}'=>lang('host_due_time').date("Y-m-d H:i:s", $host['due_time']), '{new}'=>$param['due_time']]); + $description[] = lang('old_to_new',['{old}'=>lang('host_due_time').date("Y-m-d H:i:s", $host['due_time']), '{new}'=>date("Y-m-d H:i:s", $param['due_time'])]); } if ($host['status'] != $param['status']){ $description[] = lang('old_to_new',['{old}'=>lang('host_status').lang('host_status_'.$host['status']), '{new}'=>lang('host_status_'.$param['status'])]); diff --git a/10.2.2/app/common/model/MenuModel.php b/10.2.5/app/common/model/MenuModel.php similarity index 100% rename from 10.2.2/app/common/model/MenuModel.php rename to 10.2.5/app/common/model/MenuModel.php diff --git a/10.2.2/app/common/model/NavModel.php b/10.2.5/app/common/model/NavModel.php similarity index 100% rename from 10.2.2/app/common/model/NavModel.php rename to 10.2.5/app/common/model/NavModel.php diff --git a/10.2.2/app/common/model/NoticeSettingModel.php b/10.2.5/app/common/model/NoticeSettingModel.php similarity index 100% rename from 10.2.2/app/common/model/NoticeSettingModel.php rename to 10.2.5/app/common/model/NoticeSettingModel.php diff --git a/10.2.2/app/common/model/OrderItemModel.php b/10.2.5/app/common/model/OrderItemModel.php similarity index 100% rename from 10.2.2/app/common/model/OrderItemModel.php rename to 10.2.5/app/common/model/OrderItemModel.php diff --git a/10.2.2/app/common/model/OrderModel.php b/10.2.5/app/common/model/OrderModel.php similarity index 92% rename from 10.2.2/app/common/model/OrderModel.php rename to 10.2.5/app/common/model/OrderModel.php index 837fc74f..72bb4c49 100644 --- a/10.2.2/app/common/model/OrderModel.php +++ b/10.2.5/app/common/model/OrderModel.php @@ -8,6 +8,7 @@ use app\common\logic\ModuleLogic; use app\common\logic\ResModuleLogic; use app\common\model\NoticeSettingModel; +use app\admin\model\AdminModel; /** * @title 订单模型 @@ -36,6 +37,7 @@ class OrderModel extends Model 'create_time' => 'int', 'update_time' => 'int', 'refund_amount' => 'float', + 'admin_id' => 'int', ]; /** @@ -44,10 +46,14 @@ class OrderModel extends Model * @desc 订单列表 * @author theworld * @version v1 - * @param string param.keywords - 关键字,搜索范围:订单ID,用户名称,邮箱,手机号 + * @param string param.keywords - 关键字,搜索范围:订单ID,商品名称,用户名称,邮箱,手机号 * @param int param.client_id - 用户ID * @param string param.type - 类型new新订单renew续费订单upgrade升降级订单artificial人工订单 * @param string param.status - 状态Unpaid未付款Paid已付款 + * @param string param.amount - 金额 + * @param string param.gateway - 支付方式 + * @param int param.start_time - 开始时间 + * @param int param.end_time - 结束时间 * @param int param.page - 页数 * @param int param.limit - 每页条数 * @param string param.orderby - 排序 id,type,create_time,amount,status @@ -90,56 +96,62 @@ public function orderList($param) $param['keywords'] = $param['keywords'] ?? ''; $param['type'] = $param['type'] ?? ''; $param['status'] = $param['status'] ?? ''; + $param['amount'] = $param['amount'] ?? ''; + $param['gateway'] = $param['gateway'] ?? ''; + $param['start_time'] = intval($param['start_time'] ?? 0); + $param['end_time'] = intval($param['end_time'] ?? 0); $param['orderby'] = isset($param['orderby']) && in_array($param['orderby'], ['id', 'type', 'create_time', 'amount', 'status']) ? 'o.'.$param['orderby'] : 'o.id'; + $where = function (Query $query) use ($param, $app){ + $query->where('o.type', '<>', 'recharge'); + $query->where('o.type', '<>', 'combine'); + if($app=='home'){ + $query->where('o.status', '<>', 'Cancelled'); + } + if(!empty($param['client_id'])){ + $query->where('o.client_id', $param['client_id']); + } + if(!empty($param['keywords'])){ + $query->where('o.id|p.name|c.username|c.email|c.phone', 'like', "%{$param['keywords']}%"); + } + if(!empty($param['type'])){ + $query->where('o.type', $param['type']); + } + if(!empty($param['status'])){ + $query->where('o.status', $param['status']); + } + if(!empty($param['amount'])){ + $query->where('o.amount', 'like', "%{$param['amount']}%"); + } + if(!empty($param['gateway'])){ + $query->whereRaw('o.amount>o.credit')->where('o.gateway', $param['gateway']); + } + if(!empty($param['start_time']) && !empty($param['end_time'])){ + $query->where('o.create_time', '>=', $param['start_time'])->where('o.create_time', '<=', $param['end_time']); + } + if (!empty($param['host_id'])){ + $query->where('oi.host_id',$param['host_id']); + } + }; + $count = $this->alias('o') ->field('o.id') ->leftjoin('client c', 'c.id=o.client_id') - ->where(function ($query) use($param, $app) { - $query->where('o.type', '<>', 'recharge'); - $query->where('o.type', '<>', 'combine'); - if($app=='home'){ - $query->where('o.status', '<>', 'Cancelled'); - } - if(!empty($param['client_id'])){ - $query->where('o.client_id', $param['client_id']); - } - if(!empty($param['keywords'])){ - $query->where('o.id|c.username|c.email|c.phone', 'like', "%{$param['keywords']}%"); - } - if(!empty($param['type'])){ - $query->where('o.type', $param['type']); - } - if(!empty($param['status'])){ - $query->where('o.status', $param['status']); - } - }) + ->leftjoin('order_item oi',"oi.order_id=o.id") + ->leftjoin('product p',"p.id=oi.product_id") + ->where($where) + ->group('o.id') ->count(); $orders = $this->alias('o') ->field('o.id,o.type,o.create_time,o.amount,o.status,o.gateway_name gateway,o.credit,o.client_id,c.username client_name,c.credit client_credit,c.email,c.phone_code,c.phone,c.company') ->leftjoin('client c', 'c.id=o.client_id') - ->where(function ($query) use($param, $app) { - $query->where('o.type', '<>', 'recharge'); - $query->where('o.type', '<>', 'combine'); - if($app=='home'){ - $query->where('o.status', '<>', 'Cancelled'); - } - if(!empty($param['client_id'])){ - $query->where('o.client_id', $param['client_id']); - } - if(!empty($param['keywords'])){ - $query->where('o.id|c.username|c.email|c.phone', 'like', "%{$param['keywords']}%"); - } - if(!empty($param['type'])){ - $query->where('o.type', $param['type']); - } - if(!empty($param['status'])){ - $query->where('o.status', $param['status']); - } - }) + ->leftjoin('order_item oi',"oi.order_id=o.id") + ->leftjoin('product p',"p.id=oi.product_id") + ->where($where) ->limit($param['limit']) ->page($param['page']) ->order($param['orderby'], $param['sort']) + ->group('o.id') ->select() ->toArray(); $orderId = array_column($orders, 'id'); @@ -166,10 +178,10 @@ public function orderList($param) foreach ($description as $item1){ if (count(explode('=>',$item1))==4){ $arr = explode('=>',$item1); - $itemDes = $arr[0] . ':' . $arr[1] . $arr[2] . $arr[3]; + $itemDes = $arr[0] . ':' . $arr[1] . $arr[2] . ' 价格' . $arr[3]; $newDes = $newDes.$itemDes . "\n"; }else{ - $newDes = $newDes . $item1 . "\n"; + $newDes = $newDes . ' ' . $item1 . "\n"; } } $orderItem['description'] = trim($newDes,"\n"); @@ -271,6 +283,8 @@ public function orderList($param) * @return string refund_amount - 订单已退款金额 * @return string refundable_amount - 订单可退款金额 * @return string apply_credit_amount - 订单可应用余额金额 + * @return int admin_id - 管理员ID + * @return string admin_name - 管理员名称 * @return array items - 订单子项 * @return int items[].id - 订单子项ID * @return string items[].description - 描述 @@ -287,7 +301,7 @@ public function indexOrder($id) // 获取当前应用 $app = app('http')->getName(); - $order = $this->field('id,type,amount,create_time,status,gateway_name gateway,credit,client_id,notes,refund_amount,amount_unpaid')->find($id); + $order = $this->field('id,type,amount,create_time,pay_time,status,gateway_name gateway,credit,client_id,notes,refund_amount,amount_unpaid,admin_id')->find($id); if (empty($order)){ return (object)[]; // 转换为对象 } @@ -295,6 +309,9 @@ public function indexOrder($id) $client = ClientModel::find($order['client_id']); $order['client_name'] = $client['username'] ?? ''; + $admin = AdminModel::find($order['admin_id']); + $order['admin_name'] = $admin['name'] ?? ''; + // 订单的用户ID和前台用户不一致时返回空对象 if($app=='home'){ $client_id = get_client_id(); @@ -343,7 +360,7 @@ public function indexOrder($id) foreach ($description as $item1){ if (count(explode('=>',$item1))==4){ $arr = explode('=>',$item1); - $itemDes = $arr[0] . ':' . $arr[1] . $arr[2] . $arr[3]; + $itemDes = $arr[0] . ':' . $arr[1] . $arr[2] .' 价格' . $arr[3]; $newDes = $newDes.$itemDes . "\n"; }else{ $newDes = $newDes . $item1 . "\n"; @@ -353,7 +370,9 @@ public function indexOrder($id) } if($app!='home'){ - $orderItems[$key]['edit'] = $order['status']=='Unpaid' ? ($orderItem['type']=='manual' ? 1 : 0) : 0; + //$orderItems[$key]['edit'] = $order['status']=='Unpaid' ? ($orderItem['type']=='manual' ? 1 : 0) : 0; + // wyh 20230412修改 都可更改 + $orderItems[$key]['edit'] = $order['status']=='Unpaid' ? 1 : 0; }else{ unset($orderItems[$key]['profit'], $orderItems[$key]['agent']); } @@ -408,7 +427,20 @@ public function createOrder($param) if($param['type']=='new'){ $result = $this->createNewOrder($param); }else if($param['type']=='renew'){ - + if (class_exists("addon\\idcsmart_renew\\model\\IdcsmartRenewModel")){ + $data = [ + 'id' => $param['id'], + 'billing_cycle' => $param['customfield']['billing_cycle']??'', + 'promo_code' => $param['customfield']['promo_code']??[], + //'pay' => 1, // 标记支付 + ]; + if (isset($param['customfield']['custom_amount']) && $param['customfield']['custom_amount']>=0){ + $data['custom_amount'] = $param['customfield']['custom_amount']; + } + $IdcsmartRenewModel = new \addon\idcsmart_renew\model\IdcsmartRenewModel(); + $IdcsmartRenewModel->isAdmin = true; + $result = $IdcsmartRenewModel->renew($data); + } }else if($param['type']=='upgrade'){ $result = $this->createUpgradeOrder($param); }else if($param['type']=='upgrade_config'){ @@ -494,7 +526,8 @@ private function createNewOrder($param) 'gateway' => $gateway['name'] ?? '', 'gateway_name' => $gateway['title'] ?? '', 'pay_time' => $amount>0 ? 0 : $time , - 'create_time' => $time + 'create_time' => $time, + 'admin_id' => get_admin_id(), ]); // 创建产品 @@ -819,7 +852,8 @@ public function createUpgradeOrder($param) 'gateway' => $gateway['name'] ?? '', 'gateway_name' => $gateway['title'] ?? '', 'pay_time' => $amount>0 ? 0 : $time, - 'create_time' => $time + 'create_time' => $time, + 'admin_id' => get_admin_id(), ]); // 创建升降级 $upgrade = UpgradeModel::create([ @@ -838,8 +872,12 @@ public function createUpgradeOrder($param) 'description' => $result['data']['description'], 'create_time' => $time, ]); + + if (isset($result['data']['description']) && is_array($result['data']['description'])){ + $result['data']['description'] = implode("\n",$result['data']['description']); + } // 创建订单子项 - OrderItemModel::create([ + $orderItem = OrderItemModel::create([ 'order_id' => $order->id, 'client_id' => $host['client_id'], 'host_id' => $host['id'], @@ -860,6 +898,20 @@ public function createUpgradeOrder($param) # 金额从数据库重新获取,hook里可能会修改金额,wyh改 20220804 $amount = $this->where('id',$order->id)->value('amount'); + + $product = (new ProductModel())->find($host['product_id']); + if (in_array($host['billing_cycle'],['onetime','free'])){ + $desDueTime = '∞'; + }else{ + $desDueTime = date('Y/m/d',$host['due_time']); + } + + //$des = $product['name'] . '(' .$host['name']. '),购买时长:'.$host['billing_cycle_name'] .'(' . date('Y/m/d',$host['active_time']) . '-'. $desDueTime .')'; + $des = lang('order_description_append',['{product_name}'=>$product['name'],'{name}'=>$host['name'],'{billing_cycle_name}'=>$host['billing_cycle_name'],'{time}'=>date('Y/m/d',$host['active_time']) . '-' . $desDueTime]); + $newOrderItem = OrderItemModel::find($orderItem['id']); + $newOrderItem->save([ + 'description' => $newOrderItem['description'] . "\n" . $des + ]); if($amount<=0){ // 获取接口 @@ -975,7 +1027,8 @@ public function createUpgradeConfigOrder($param) 'gateway' => $gateway['name'] ?? '', 'gateway_name' => $gateway['title'] ?? '', 'pay_time' => $amount>0 ? 0 : $time, - 'create_time' => $time + 'create_time' => $time, + 'admin_id' => get_admin_id(), ]); // 创建升降级 $upgrade = UpgradeModel::create([ @@ -994,15 +1047,19 @@ public function createUpgradeConfigOrder($param) 'description' => $param['description'] ?? '', 'create_time' => $time, ]); + // 创建订单子项 - OrderItemModel::create([ + if (isset($param['description']) && is_array($param['description'])){ + $param['description'] = implode("\n",$param['description']); + } + $orderItem = OrderItemModel::create([ 'order_id' => $order->id, 'client_id' => $host['client_id'], 'host_id' => $host['id'], 'product_id' => $host['product_id'], 'type' => 'upgrade', 'rel_id' => $upgrade->id, - 'description' => $param['description'] ?? '', + 'description' => ($param['description'] ?? ''), 'amount' => $amount, 'gateway' => $gateway['name'] ?? '', 'gateway_name' => $gateway['title'] ?? '', @@ -1017,6 +1074,20 @@ public function createUpgradeConfigOrder($param) # 金额从数据库重新获取,hook里可能会修改金额,wyh改 20220804 $amount = $this->where('id',$order->id)->value('amount'); + $product = (new ProductModel())->find($host['product_id']); + if (in_array($host['billing_cycle'],['onetime','free'])){ + $desDueTime = '∞'; + }else{ + $desDueTime = date('Y/m/d',$host['due_time']); + } + + //$des = $product['name'] . '(' .$host['name']. '),购买时长:'.$host['billing_cycle_name'] .'(' . date('Y/m/d',$host['active_time']) . '-'. $desDueTime .')'; + $des = lang('order_description_append',['{product_name}'=>$product['name'],'{name}'=>$host['name'],'{billing_cycle_name}'=>$host['billing_cycle_name'],'{time}'=>date('Y/m/d',$host['active_time']) . '-' . $desDueTime]); + $newOrderItem = OrderItemModel::find($orderItem['id']); + $newOrderItem->save([ + 'description' => $newOrderItem['description'] . "\n" . $des + ]); + if($amount<=0){ $this->processPaidOrder($order->id); @@ -1134,7 +1205,8 @@ public function createOrderBase($param) 'gateway_name' => $gateway['title'] ?? '', 'client_id' => $param['client_id'], 'pay_time' => $param['status']=='Paid' ? $time : 0, - 'create_time' => $time + 'create_time' => $time, + 'admin_id' => get_admin_id(), ]); // 新建订单子项 @@ -1272,9 +1344,10 @@ public function updateOrderItem($param) return ['status'=>400, 'msg'=>lang('order_item_is_not_exist')]; } - if ($orderItem['type']!='manual'){ + // wyh 20230412 注释 所有类型都可以修改 + /*if ($orderItem['type']!='manual'){ return ['status'=>400, 'msg'=>lang('order_item_cannot_update')]; - } + }*/ // 验证订单ID $order = $this->find($orderItem['order_id']); @@ -1295,7 +1368,7 @@ public function updateOrderItem($param) $this->startTrans(); try { OrderItemModel::update([ - 'type' => 'manual', + //'type' => 'manual', 'description' => $param['description'], 'amount' => $param['amount'], 'create_time' => time() @@ -1316,7 +1389,7 @@ public function updateOrderItem($param) 'description' => '后台管理员调整订单价格,发送邮件', 'task_data' => [ 'name'=>'admin_order_amount',//发送动作名称 - 'order_id'=>$param['id'],//订单ID + 'order_id'=>$order['id'],//订单ID ], ]); add_task([ @@ -1324,7 +1397,7 @@ public function updateOrderItem($param) 'description' => '后台管理员调整订单价格,发送短信', 'task_data' => [ 'name'=>'admin_order_amount',//发送动作名称 - 'order_id'=>$param['id'],//订单ID + 'order_id'=>$order['id'],//订单ID ], ]); @@ -1396,7 +1469,7 @@ public function deleteOrderItem($id) 'description' => '后台管理员调整订单价格,发送邮件', 'task_data' => [ 'name'=>'admin_order_amount',//发送动作名称 - 'order_id'=>$id,//订单ID + 'order_id'=>$order['id'],//订单ID ], ]); add_task([ @@ -1404,7 +1477,7 @@ public function deleteOrderItem($id) 'description' => '后台管理员调整订单价格,发送短信', 'task_data' => [ 'name'=>'admin_order_amount',//发送动作名称 - 'order_id'=>$id,//订单ID + 'order_id'=>$order['id'],//订单ID ], ]); @@ -2211,7 +2284,7 @@ public function hostOrderHandle($id) { $HostModel = new HostModel(); $host = $HostModel->alias('h') - ->field('h.status,h.billing_cycle,h.billing_cycle_time,p.auto_setup,p.creating_notice_sms,p.creating_notice_mail') + ->field('h.status,h.billing_cycle,h.billing_cycle_name,h.name,h.billing_cycle_time,p.auto_setup,p.creating_notice_sms,p.creating_notice_mail,h.order_id,p.name as product_name,h.active_time') ->leftjoin('product p','h.product_id=p.id') ->where('h.id',$id) ->find(); @@ -2231,6 +2304,30 @@ public function hostOrderHandle($id) 'due_time' => $dueTime, ],['id'=>$id]); + # 更改新购订单子项描述 + $OrderItemModel = new OrderItemModel(); + $orderItem = $OrderItemModel->where('order_id',$host['order_id']) + ->where('host_id',$id) + ->where('type','host') + ->find(); + if (!empty($orderItem)){ + if (in_array($host['billing_cycle'],['onetime','free'])){ + $desDueTime = '∞'; + }else{ + $desDueTime = date('Y/m/d',$dueTime); + } + $des = $host['product_name'] . '(' .$host['name']. '),购买时长:'.$host['billing_cycle_name'] .'(' . date('Y/m/d',$host['active_time']) . '-'. $desDueTime .')'; + //$des = lang('order_description_append',['{product_name}'=>$host['product_name'],'{name}'=>$host['name'],'{billing_cycle_name}'=>$host['billing_cycle_name'] ,'{time}'=>date('Y/m/d H',$host['active_time']) . '-' . date('Y/m/d H',date('Y/m/d H',$dueTime))]); + $orderItemDes = explode("\n",$orderItem['description'])??[]; + if (count($orderItemDes)>=2){ + array_pop($orderItemDes); + array_push($orderItemDes,$des); + } + $orderItem->save([ + 'description' => implode("\n",$orderItemDes) + ]); + } + # 暂停时,付款后解除 if ($host->status == 'Suspended'){ add_task([ diff --git a/10.2.2/app/common/model/OrderTmpModel.php b/10.2.5/app/common/model/OrderTmpModel.php similarity index 100% rename from 10.2.2/app/common/model/OrderTmpModel.php rename to 10.2.5/app/common/model/OrderTmpModel.php diff --git a/10.2.2/app/common/model/PartnerModel.php b/10.2.5/app/common/model/PartnerModel.php similarity index 100% rename from 10.2.2/app/common/model/PartnerModel.php rename to 10.2.5/app/common/model/PartnerModel.php diff --git a/10.2.2/app/common/model/ProductGroupModel.php b/10.2.5/app/common/model/ProductGroupModel.php similarity index 100% rename from 10.2.2/app/common/model/ProductGroupModel.php rename to 10.2.5/app/common/model/ProductGroupModel.php diff --git a/10.2.2/app/common/model/ProductModel.php b/10.2.5/app/common/model/ProductModel.php similarity index 98% rename from 10.2.2/app/common/model/ProductModel.php rename to 10.2.5/app/common/model/ProductModel.php index 31eb2768..6b8e9c59 100644 --- a/10.2.2/app/common/model/ProductModel.php +++ b/10.2.5/app/common/model/ProductModel.php @@ -1318,6 +1318,15 @@ public function settle($param) }else{ $ModuleLogic->afterSettle($product, $host->id, $param['config_options']); } + + //$des = $product['name'] . '(' .$host['name']. '),购买时长:'.$host['billing_cycle_name'] .'(' . date('Y/m/d H',$host['active_time']) . '-'. date('Y/m/d H',$host['active_time']) .')'; + if (in_array($host['billing_cycle'],['onetime','free'])){ + $desDueTime = '∞'; + }else{ + $desDueTime = date('Y/m/d',time() + intval($host['billing_cycle_time'])); + } + $des = lang('order_description_append',['{product_name}'=>$product['name'],'{name}'=>$host['name'],'{billing_cycle_name}'=>$host['billing_cycle_name'],'{time}'=>date('Y/m/d',$host['active_time']) . '-' . $desDueTime]); + $orderItem[] = [ 'order_id' => $order->id, 'client_id' => $clientId, @@ -1326,7 +1335,7 @@ public function settle($param) 'type' => 'host', 'rel_id' => $host->id, 'amount' => $param['price'], - 'description' => $param['description'], + 'description' => $param['description'] . "\n" . $des, 'create_time' => $time, ]; } diff --git a/10.2.2/app/common/model/ProductUpgradeProductModel.php b/10.2.5/app/common/model/ProductUpgradeProductModel.php similarity index 100% rename from 10.2.2/app/common/model/ProductUpgradeProductModel.php rename to 10.2.5/app/common/model/ProductUpgradeProductModel.php diff --git a/10.2.2/app/common/model/RefundRecordModel.php b/10.2.5/app/common/model/RefundRecordModel.php similarity index 100% rename from 10.2.2/app/common/model/RefundRecordModel.php rename to 10.2.5/app/common/model/RefundRecordModel.php diff --git a/10.2.2/app/common/model/ServerGroupModel.php b/10.2.5/app/common/model/ServerGroupModel.php similarity index 100% rename from 10.2.2/app/common/model/ServerGroupModel.php rename to 10.2.5/app/common/model/ServerGroupModel.php diff --git a/10.2.2/app/common/model/ServerModel.php b/10.2.5/app/common/model/ServerModel.php similarity index 97% rename from 10.2.2/app/common/model/ServerModel.php rename to 10.2.5/app/common/model/ServerModel.php index 3315281a..b76d730a 100644 --- a/10.2.2/app/common/model/ServerModel.php +++ b/10.2.5/app/common/model/ServerModel.php @@ -35,7 +35,8 @@ class ServerModel extends Model * @desc 接口列表 * @author hh * @version v1 - * @param string param.keywords - 关键字 + * @param string param.keywords - 关键字,搜索接口ID/接口名称/分组名称 + * @param string param.status - 状态0禁用,1启用 * @param int param.page 1 页数 * @param int param.limit 20 每页条数 * @param string param.orderby id 排序(id,name,server_group_id,status) @@ -62,6 +63,7 @@ public function serverList($param) }else{ $param['orderby'] = 's.'.$param['orderby']; } + $param['status'] = $param['status'] ?? ''; $where = function (Query $query) use($param) { if(isset($param['keywords']) && trim($param['keywords']) !== ''){ @@ -70,6 +72,9 @@ public function serverList($param) if(!empty($param['server_group_id'])){ $query->where('s.server_group_id', $param['server_group_id']); } + if(in_array($param['status'], ['0', '1'])){ + $query->where('s.status', $param['status']); + } }; $ModuleLogic = new ModuleLogic(); diff --git a/10.2.2/app/common/model/SmsTemplateModel.php b/10.2.5/app/common/model/SmsTemplateModel.php similarity index 98% rename from 10.2.2/app/common/model/SmsTemplateModel.php rename to 10.2.5/app/common/model/SmsTemplateModel.php index aeffa547..1f3e6e77 100644 --- a/10.2.2/app/common/model/SmsTemplateModel.php +++ b/10.2.5/app/common/model/SmsTemplateModel.php @@ -444,10 +444,13 @@ public function test($param) $template_param = [ 'code'=> rand(10000,99999), ]; + $data = [ 'content' => $sms_template['content'], 'template_param' => $template_param, 'name' => $param['name'], + 'template_id' => $sms_template['template_id'], + 'test' => true // 测试模板 ]; if($sms_template['type'] == 0){ $data['mobile'] = $param['phone']; @@ -515,6 +518,7 @@ private function smsMethods($cmd,$param){ 'config' => $config?:[], 'title' => $param['title'] ? trim($param['title']) : '', 'content' => $param['content'] ? trim($param['content']) : '', + 'notes' => $param['notes']??'' ]; }else if(strpos($cmd,"put")!==false){ $data = [ @@ -522,6 +526,7 @@ private function smsMethods($cmd,$param){ 'config' => $config?:[], 'title' => $param['title'] ? trim($param['title']) : '', 'content' => $param['content'] ? trim($param['content']) : '', + 'notes' => $param['notes']??'' ]; }else if(strpos($cmd,"delete")!==false){ $data = [ @@ -533,9 +538,14 @@ private function smsMethods($cmd,$param){ 'mobile' => $param['mobile'], 'content' => $param['content'], 'templateParam' => $param['template_param'], + 'template_id' => $param['template_id'], 'config' => $config?:[], ]; + if (isset($param['test'])){ + $data['test'] = $param['test']; + } } + return $sms->$cmd($data); } diff --git a/10.2.5/app/common/model/SupplierModel.php b/10.2.5/app/common/model/SupplierModel.php new file mode 100644 index 00000000..701509ee --- /dev/null +++ b/10.2.5/app/common/model/SupplierModel.php @@ -0,0 +1,414 @@ + 'int', + 'type' => 'string', + 'name' => 'string', + 'url' => 'string', + 'username' => 'string', + 'token' => 'string', + 'secret' => 'string', + 'contact' => 'string', + 'notes' => 'string', + 'create_time' => 'int', + 'update_time' => 'int', + ]; + + # 供应商列表 + public function supplierList($param) + { + $param['keywords'] = $param['keywords'] ?? ''; + $param['orderby'] = isset($param['orderby']) && in_array($param['orderby'], ['id']) ? 'a.'.$param['orderby'] : 'a.id'; + + $where = function (Query $query) use ($param){ + if (!empty($param['keywords'])){ + $query->where('a.name|a.url','like',"%{$param['keywords']}%"); + } + }; + $count = $this->alias('a') + ->field('a.id') + ->where($where) + ->count(); + + + + $list = $this->alias('a') + ->field('a.id,a.type,a.name,a.url') + ->where($where) + ->group('a.id') + ->limit($param['limit']) + ->page($param['page']) + ->order($param['orderby'], $param['sort']) + ->select() + ->toArray(); + $supplierId = array_column($list, 'id'); + $productNum = UpstreamProductModel::field('COUNT(id) num,supplier_id')->whereIn('supplier_id', $supplierId)->group('supplier_id')->select()->toArray();; + $productNum = array_column($productNum, 'num', 'supplier_id'); + $hostNum = UpstreamHostModel::field('COUNT(id) num,supplier_id')->whereIn('supplier_id', $supplierId)->group('supplier_id')->select()->toArray();; + $hostNum = array_column($hostNum, 'num', 'supplier_id'); + + foreach ($list as $key => $value) { + $list[$key]['host_num'] = $hostNum[$value['id']] ?? 0; + $list[$key]['product_num'] = $productNum[$value['id']] ?? 0; + } + + return ['list' => $list, 'count' => $count]; + } + + # 供应商详情 + public function indexSupplier($id) + { + $supplier = $this->field('id,type,name,url,username,token,secret,contact,notes')->find($id); + if(empty($supplier)){ + return (object)[]; + } + $supplier['token'] = aes_password_decode($supplier['token']); + $supplier['secret'] = aes_password_decode($supplier['secret']); + return $supplier; + } + + # 添加供应商 + public function createSupplier($param) + { + if($param['type']=='whmcs'){ + $param['secret'] = '-----BEGIN PRIVATE KEY----- +MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQC6f8yTpySPyw+X +u0dQnBQYu4xCOV30HV3ZvpiPtANb7OWj+DsxRF2uidtL1GWHmAzJaa6Mq41FdP2l +WNr5o9BidExb55TDAAxWS3KUODoOvX6guqVDmN3eHw7ssFhCs704gKkQY62aL7hW +RuzOEykV71O+afMQ4cZg8NxE7ce0KwrD5uuqIXo0W6OrdXgq1t46W2OJU5AKbGEh +H/vHn9DONOlmIWnwFXjaoiOvl9ulzZQ1te5mMhu4smTkn7+xxjF/5ruQClTxzmrZ +uQ9s6JGqIewj4qktMPymsamz/7ZuLXAcTTMIfWeQtn74BmZ2vbx6uHHqTv2DY9ed +llPC/zcV1npEP1EiA+yGAi1qEGp3yTy+yCIv1ucwm+qbfvhHtcpOAltICs0rOmUA +NPsFNyjTDxERbxs4/XlCaFAPrejAUik0Eolf9ysKpXJwsrt+OIs8r3aW7+DY2+xA +tevYP+EOWCVfk6g6mVo0vEG5GJAiG1mD+yJbHYlbKVWXP5WdRlaw7esXmHHrAwYA +rnWM6U0NextunItco/v8wcwCJHKJTDRlZPkZaaQaJS7q5vxnCZ7YgpXjh3beJW4X +kf416xuF3edndQsrKaVS34f5tHxZMsFApPYYI7NgsAO+Y11iVGsPb9DvvvMz2Ynn +y0RQjWa6orIM5V4NLrGwZkSpVW33tQIDAQABAoICAB8p0b5udH6OmNlq0tzWZ8lG +NYavXVK4QYFsBsQkeVc3+5ttlD6ERP8wS/Oc1yZUMvbI8QDSfbW4edXSRizmwaBh +/Ixy4vm+nVEiJFA+IP1rjqg+5/Smq5Q9LlpAkU78B8dUQGvbrBuSk8Pe8BzzOK9Q +oXa074fHokV6mePus6sYciEQChsQowHyuiOhamYGJ3Yq5TQCQZRsTcKiPIk73EFI +uCN3u+MBQ4ONCleCEZLgCj77Wo27G8S+EnvdccO78XOE05ybDVymeFZPRROWvRhn +uLS6YDiL8fvMviW0ugApGY2xHLDze4XD6O167E41IDSFc4uKjXQSD+pmPzLbQJHd +JgbVeOTBsev4LhGHLJNqHUH6elIbddyt4aI01P/6dDjpHqN+vHA4oVyVIDFcBDQq +3wnJkIpxdovnYEuw+FtAuwRnEpGWkLiLWm9DydRRu6ONIkpK8K6oChrqUB5dMk7F +nXj9G68BLScydHN8YPTk7XUEJKhzi8uxeyRwM7pPy8sj1sd4MqhcO62XJu/AJdBK +hS2RR+5/pJOKjj0uCgSRkplDUm0gOYEPKMmkJ12uh6MfF8308760d5zP+6w5B2ei +sCMu96pjNgaSW2uVXBp+3z1hpTPgcAuZSmzL99j7Qq5ZKRAmTDJuH5ClC8aRbOv3 +/RjTrx/6d6rCJUxLwQL1AoIBAQDzRhRUz5ceYNOV7XwMC+Wq9Ry7kUOTOBAtMvhd +lop8xHurKtWDOcuH9ZEWJRoZ1CqfGaP7oZ8VcVW2bD/sq5iXPBXDkYNDmrxHakQW +E3/5jsxUWhNSxTj0Nvr8GJKzpgihOsrUVxYWgDDdrA/6+O1xcvhatPkOagimzCIL +suihRMe7vuA9oGterRtQl6oCVA3JGry3iV0pwgz9IspAoAPrrYCxUkBkP0uszq5m +j8RhBXRKybTmDyVft6DFrd8KcHAUsA8N8XLOYWSt03sizhsBdBSVH3YGnPMsVY8T +wriSkRTQT47LyLDD+kU+tXdq+5ZgI1HdpG/wOrYcsD9NpJp/AoIBAQDEQWVAGFdi +ONV2XvsmMXyGemfG2WybxNEw4NNAob/ajVom8y+F0u++XgNpb7oQpbOEKMi5P0yT +XDaFVDS2me7IOKtWxtlJBzLB6/eif4x1LLSZKENAd0tzdeYU1KKUj3XU7S9lIv56 +8lF9ZFA9oUZW25U+cGh7ochwkGEXLMZgJwuLkVZaXwhOP9cQYi2i1tu74VIzzK40 +v5/i6nIpdRfFxKir/cyXvdekTfvRupnfD1AA1x8RM0Wo4bRn1CgbhD2YOT3qD6jo +Q9GSalIuef/A6WTM2Z0Ao8lsoVlPWvZcVWr/1PGY8lgEPSq0edFqVnGjtdItqrUr +BgPySgrEvAvLAoIBAD/DzKx2RSwHQS55MxyNOcPXv5JCfy3lcggG5ibRwLb3YVr6 +PUDKM1kNutvNGcxPWmSdeegI8wPR0x+fvBmy2Ko7a5D5YSilNFibuAD5V3/4OAKc +IZh+bXFFv/+4CSvhhz2LhYKm2PlI3IYeBYpJGSO1ePd9nBJ1JJNjykC6wlMTDi9d +1rUQiVQll5VGS5+UnJBr269X5/18CZ+IMO9DggOSVLslzg74sEM5YWksodK0dUjt +Ged7bNZr8U4fRukbk6U4iJmlAeyqhpMxbYMv9tAotwRnXK5bETo7qucJEQwJzyTS +1aEAl6SmwuOu+QAntcC5QUoRQe371aQrZkxZqs0CggEASy9Obb6lg3CIfp+mkZw1 +u4MbTLew/v/osFQBOmp9CGpMlk1l8Fu+Eu0LW5I88vG4EzJYq3dPi8iw7mUzCJ1y +N+xV35mwVmTWkionJW69zYoB6gbdtM2+7w3ExkgrvMQ0/Qycsp80ZL9+bo5Gm0W0 +n8PhqhkAPhTdqBn3yBwUJ3Pt3VshfN+ZW/jjGFi0aQTtC04n4sZQGs8qnpD4iV9d +axuLDtDdV2iYO07Q4Skel7DTEm9XbIx67FcDeR9y+g+wVSfgy1GSgOCyYegvcbS1 +QR9oyX24wyz8Foy9nUQYy4jBxB69K73z8DPKr3dXveg+Aty+F1alr0TPsDujYnkz +/wKCAQBPiGp4P5EytBpxp3sXW/k6KXLXBaALIuc/ib1r6hz6wdGlBlJLdUNzwvNi +Upg39NExLREKQPiwxwiXQ9twIY/dXEUvn5QaC9NVeM1tm/ciwfug/jmkKhpqHSHs ++RkEmcomqpx5bDfAxwL3v67xMykSMsRUm84VQ9RmIzUqDxyD6KJt+1KrUU5HTBew +dlAimSBOmDofTVE5lNXqx49fB3OzzWrLGR8PA7RAl9bGgaqUlJV2plU1fitmvyHu +utAb35077ruJC5nMrezGxleVi8IYW4VhHYwdh9oEjdFMi27tqIK63dAOizYNp6he +VIix+jUQp0t+3mbq07+TRxbkbhOc +-----END PRIVATE KEY-----'; + } + $this->startTrans(); + try{ + $supplier = $this->create([ + 'type' => $param['type'], + 'name' => $param['name'], + 'url' => $param['url'], + 'username' => $param['username'], + 'token' => aes_password_encode($param['token']), + 'secret' => aes_password_encode(str_replace("\r\n", "\n", $param['secret'])), + 'contact' => $param['contact'] ?? '', + 'notes' => $param['notes'] ?? '', + 'create_time' => time(), + ]); + + # 记录日志 + active_log(lang('log_create_supplier',['{admin}'=>request()->admin_name,'{name}'=>$param['name']]), 'supplier', $supplier->id); + $this->commit(); + }catch (\Exception $e){ + $this->rollback(); + return ['status'=>400, 'msg'=>lang('create_fail')]; + } + + return ['status'=>200, 'msg'=>lang('create_success')]; + } + + # 编辑供应商 + public function updateSupplier($param) + { + $supplier = $this->find($param['id']); + if(empty($supplier)){ + return ['status' => 400, 'msg' => lang('supplier_is_not_exist')]; + } + $supplier = $supplier->toArray(); + $token = aes_password_decode($supplier['token']); + $secret = aes_password_decode($supplier['secret']); + unset($supplier['token'],$supplier['secret']); + # 日志描述 + $logDescription = log_description($supplier,$param,'supplier'); + if($token!=$param['token']){ + $logDescription = $logDescription.','.lang('log_supplier_token'); + } + if($secret!=$param['secret']){ + $logDescription = $logDescription.','.lang('log_supplier_secret'); + } + $logDescription = ltrim(',', $logDescription); + if($param['type']=='whmcs'){ + $param['secret'] = '-----BEGIN PRIVATE KEY----- +MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQC6f8yTpySPyw+X +u0dQnBQYu4xCOV30HV3ZvpiPtANb7OWj+DsxRF2uidtL1GWHmAzJaa6Mq41FdP2l +WNr5o9BidExb55TDAAxWS3KUODoOvX6guqVDmN3eHw7ssFhCs704gKkQY62aL7hW +RuzOEykV71O+afMQ4cZg8NxE7ce0KwrD5uuqIXo0W6OrdXgq1t46W2OJU5AKbGEh +H/vHn9DONOlmIWnwFXjaoiOvl9ulzZQ1te5mMhu4smTkn7+xxjF/5ruQClTxzmrZ +uQ9s6JGqIewj4qktMPymsamz/7ZuLXAcTTMIfWeQtn74BmZ2vbx6uHHqTv2DY9ed +llPC/zcV1npEP1EiA+yGAi1qEGp3yTy+yCIv1ucwm+qbfvhHtcpOAltICs0rOmUA +NPsFNyjTDxERbxs4/XlCaFAPrejAUik0Eolf9ysKpXJwsrt+OIs8r3aW7+DY2+xA +tevYP+EOWCVfk6g6mVo0vEG5GJAiG1mD+yJbHYlbKVWXP5WdRlaw7esXmHHrAwYA +rnWM6U0NextunItco/v8wcwCJHKJTDRlZPkZaaQaJS7q5vxnCZ7YgpXjh3beJW4X +kf416xuF3edndQsrKaVS34f5tHxZMsFApPYYI7NgsAO+Y11iVGsPb9DvvvMz2Ynn +y0RQjWa6orIM5V4NLrGwZkSpVW33tQIDAQABAoICAB8p0b5udH6OmNlq0tzWZ8lG +NYavXVK4QYFsBsQkeVc3+5ttlD6ERP8wS/Oc1yZUMvbI8QDSfbW4edXSRizmwaBh +/Ixy4vm+nVEiJFA+IP1rjqg+5/Smq5Q9LlpAkU78B8dUQGvbrBuSk8Pe8BzzOK9Q +oXa074fHokV6mePus6sYciEQChsQowHyuiOhamYGJ3Yq5TQCQZRsTcKiPIk73EFI +uCN3u+MBQ4ONCleCEZLgCj77Wo27G8S+EnvdccO78XOE05ybDVymeFZPRROWvRhn +uLS6YDiL8fvMviW0ugApGY2xHLDze4XD6O167E41IDSFc4uKjXQSD+pmPzLbQJHd +JgbVeOTBsev4LhGHLJNqHUH6elIbddyt4aI01P/6dDjpHqN+vHA4oVyVIDFcBDQq +3wnJkIpxdovnYEuw+FtAuwRnEpGWkLiLWm9DydRRu6ONIkpK8K6oChrqUB5dMk7F +nXj9G68BLScydHN8YPTk7XUEJKhzi8uxeyRwM7pPy8sj1sd4MqhcO62XJu/AJdBK +hS2RR+5/pJOKjj0uCgSRkplDUm0gOYEPKMmkJ12uh6MfF8308760d5zP+6w5B2ei +sCMu96pjNgaSW2uVXBp+3z1hpTPgcAuZSmzL99j7Qq5ZKRAmTDJuH5ClC8aRbOv3 +/RjTrx/6d6rCJUxLwQL1AoIBAQDzRhRUz5ceYNOV7XwMC+Wq9Ry7kUOTOBAtMvhd +lop8xHurKtWDOcuH9ZEWJRoZ1CqfGaP7oZ8VcVW2bD/sq5iXPBXDkYNDmrxHakQW +E3/5jsxUWhNSxTj0Nvr8GJKzpgihOsrUVxYWgDDdrA/6+O1xcvhatPkOagimzCIL +suihRMe7vuA9oGterRtQl6oCVA3JGry3iV0pwgz9IspAoAPrrYCxUkBkP0uszq5m +j8RhBXRKybTmDyVft6DFrd8KcHAUsA8N8XLOYWSt03sizhsBdBSVH3YGnPMsVY8T +wriSkRTQT47LyLDD+kU+tXdq+5ZgI1HdpG/wOrYcsD9NpJp/AoIBAQDEQWVAGFdi +ONV2XvsmMXyGemfG2WybxNEw4NNAob/ajVom8y+F0u++XgNpb7oQpbOEKMi5P0yT +XDaFVDS2me7IOKtWxtlJBzLB6/eif4x1LLSZKENAd0tzdeYU1KKUj3XU7S9lIv56 +8lF9ZFA9oUZW25U+cGh7ochwkGEXLMZgJwuLkVZaXwhOP9cQYi2i1tu74VIzzK40 +v5/i6nIpdRfFxKir/cyXvdekTfvRupnfD1AA1x8RM0Wo4bRn1CgbhD2YOT3qD6jo +Q9GSalIuef/A6WTM2Z0Ao8lsoVlPWvZcVWr/1PGY8lgEPSq0edFqVnGjtdItqrUr +BgPySgrEvAvLAoIBAD/DzKx2RSwHQS55MxyNOcPXv5JCfy3lcggG5ibRwLb3YVr6 +PUDKM1kNutvNGcxPWmSdeegI8wPR0x+fvBmy2Ko7a5D5YSilNFibuAD5V3/4OAKc +IZh+bXFFv/+4CSvhhz2LhYKm2PlI3IYeBYpJGSO1ePd9nBJ1JJNjykC6wlMTDi9d +1rUQiVQll5VGS5+UnJBr269X5/18CZ+IMO9DggOSVLslzg74sEM5YWksodK0dUjt +Ged7bNZr8U4fRukbk6U4iJmlAeyqhpMxbYMv9tAotwRnXK5bETo7qucJEQwJzyTS +1aEAl6SmwuOu+QAntcC5QUoRQe371aQrZkxZqs0CggEASy9Obb6lg3CIfp+mkZw1 +u4MbTLew/v/osFQBOmp9CGpMlk1l8Fu+Eu0LW5I88vG4EzJYq3dPi8iw7mUzCJ1y +N+xV35mwVmTWkionJW69zYoB6gbdtM2+7w3ExkgrvMQ0/Qycsp80ZL9+bo5Gm0W0 +n8PhqhkAPhTdqBn3yBwUJ3Pt3VshfN+ZW/jjGFi0aQTtC04n4sZQGs8qnpD4iV9d +axuLDtDdV2iYO07Q4Skel7DTEm9XbIx67FcDeR9y+g+wVSfgy1GSgOCyYegvcbS1 +QR9oyX24wyz8Foy9nUQYy4jBxB69K73z8DPKr3dXveg+Aty+F1alr0TPsDujYnkz +/wKCAQBPiGp4P5EytBpxp3sXW/k6KXLXBaALIuc/ib1r6hz6wdGlBlJLdUNzwvNi +Upg39NExLREKQPiwxwiXQ9twIY/dXEUvn5QaC9NVeM1tm/ciwfug/jmkKhpqHSHs ++RkEmcomqpx5bDfAxwL3v67xMykSMsRUm84VQ9RmIzUqDxyD6KJt+1KrUU5HTBew +dlAimSBOmDofTVE5lNXqx49fB3OzzWrLGR8PA7RAl9bGgaqUlJV2plU1fitmvyHu +utAb35077ruJC5nMrezGxleVi8IYW4VhHYwdh9oEjdFMi27tqIK63dAOizYNp6he +VIix+jUQp0t+3mbq07+TRxbkbhOc +-----END PRIVATE KEY-----'; + } + $this->startTrans(); + try{ + $this->update([ + 'type' => $param['type'], + 'name' => $param['name'], + 'url' => $param['url'], + 'username' => $param['username'], + 'token' => aes_password_encode($param['token']), + 'secret' => aes_password_encode(str_replace("\r\n", "\n", $param['secret'])), + 'contact' => $param['contact'] ?? '', + 'notes' => $param['notes'] ?? '', + 'update_time' => time(), + ], ['id' => $param['id']]); + + # 记录日志 + active_log(lang('log_update_supplier',['{admin}'=>request()->admin_name,'{name}'=>$param['name'],'{description}'=>$logDescription]),'supplier',$supplier['id']); + $this->commit(); + }catch (\Exception $e){ + $this->rollback(); + return ['status'=>400,'msg'=>lang('update_fail')]; + } + + return ['status'=>200,'msg'=>lang('update_success')]; + } + + # 删除供应商 + public function deleteSupplier($id) + { + $supplier = $this->find($id); + if(empty($supplier)){ + return ['status' => 400, 'msg' => lang('supplier_is_not_exist')]; + } + $productCount = UpstreamProductModel::where('supplier_id', $id)->count(); + if($productCount>0){ + return ['status' => 400, 'msg' => lang('cannot_delete_supplier')]; + } + + $this->startTrans(); + try{ + $this->destroy($id); + + # 记录日志 + active_log(lang('log_delete_supplier',['{admin}'=>request()->admin_name,'{name}'=>$supplier['name']]),'supplier',$supplier->id); + $this->commit(); + }catch (\Exception $e){ + $this->rollback(); + return ['status'=>400,'msg'=>lang('delete_fail')]; + } + + return ['status'=>200,'msg'=>lang('delete_success')]; + } + + # 检查供应商接口连接状态 + public function supplierStatus($id) + { + $supplier = $this->find($id); + if(empty($supplier)){ + return ['status' => 400, 'msg' => lang('supplier_is_not_exist')]; + } + // 从上游商品详情拉取 + $UpstreamLogic = new UpstreamLogic(); + $res = $UpstreamLogic->upstreamApiAuth(['type' => $supplier['type'], 'url' => $supplier['url'], 'username' => $supplier['username'], 'password' => aes_password_decode($supplier['token'])]); + if($res['status']==400){ + return ['status'=>400,'msg'=>$res['msg']]; + } + return ['status'=>200,'msg'=>lang('success_message')]; + } + + # 获取供应商商品列表 + public function supplierProduct($id) + { + $supplier = $this->find($id); + if(empty($supplier)){ + return ['list' => [], 'count' => 0]; + } + // 从上游商品详情拉取 + $UpstreamLogic = new UpstreamLogic(); + $res = $UpstreamLogic->upstreamProductList(['url' => $supplier['url'], 'type' => $supplier['type']]); + return $res; + } + + public function apiAuth($api_id,$force) + { + $this->startTrans(); + + try{ + $path='api/v1/auth'; + + $supplier = $this->where('id',$api_id)->find(); + if (empty($supplier)){ + throw new \Exception(lang('supplier_is_not_exist')); + } + + $url = rtrim($supplier['url'],'/'); + + if($supplier['type']=='whmcs'){ + $supplier['token'] = aes_password_decode($supplier['token']); + $supplier['secret'] = aes_password_decode($supplier['secret']); + } + elseif ($supplier['type']=='finance'){ // 老财务 + $path = 'zjmf_api_login'; + + $key = 'api_auth_login_' . AUTHCODE . '_' . $api_id; + + $jwt = idcsmart_cache($key); + + if (empty($jwt) || $force){ + + $apiUrl = $url . '/' . $path; + + $data = [ + 'username' => $supplier['username'], + 'password' => aes_password_decode($supplier['token']) + ]; + + $result = curl($apiUrl,$data); + if ($result['http_code']!=200){ + idcsmart_cache($key,null); + throw new \Exception($result['content']??"api_auth_fail"); + } + $result = json_decode($result['content'], true); + + if($result['status'] == 200){ + $jwt = $result['jwt']; + + idcsmart_cache($key,$jwt,2*3600); + }else{ + throw new \Exception($result['msg']??"api_auth_fail"); + } + } + } + else{ + $key = 'api_auth_login_' . AUTHCODE . '_' . $api_id; + + $jwt = idcsmart_cache($key); + + if (empty($jwt) || $force){ + + $apiUrl = $url . '/' . $path; + + $data = [ + 'username' => $supplier['username'], + 'password' => aes_password_decode($supplier['token']) + ]; + + $result = curl($apiUrl,$data); + if ($result['http_code']!=200){ + idcsmart_cache($key,null); + throw new \Exception($result['content']??"api_auth_fail"); + } + $result = json_decode($result['content'], true); + + if($result['status'] == 200){ + $jwt = $result['data']['jwt']; + + idcsmart_cache($key,$jwt,2*3600); + }else{ + throw new \Exception($result['msg']??"api_auth_fail"); + } + } + } + + + $this->commit(); + }catch (\Exception $e){ + $this->rollback(); + + return ['status'=>400,'msg'=>$e->getMessage()]; + } + + return ['status'=>200,'msg'=>lang('success_message'),'data'=>['jwt'=>$jwt ?? '', 'url'=>$url, 'supplier' => $supplier]]; + } +} \ No newline at end of file diff --git a/10.2.2/app/common/model/SystemLogModel.php b/10.2.5/app/common/model/SystemLogModel.php similarity index 100% rename from 10.2.2/app/common/model/SystemLogModel.php rename to 10.2.5/app/common/model/SystemLogModel.php diff --git a/10.2.2/app/common/model/TaskModel.php b/10.2.5/app/common/model/TaskModel.php similarity index 85% rename from 10.2.2/app/common/model/TaskModel.php rename to 10.2.5/app/common/model/TaskModel.php index 54904f4d..1110b687 100644 --- a/10.2.2/app/common/model/TaskModel.php +++ b/10.2.5/app/common/model/TaskModel.php @@ -1,6 +1,7 @@ where('id|description', 'like', "%{$param['keywords']}%"); + } + if(!empty($param['status'])){ + $query->where('status', $param['status']); + } + if(!empty($param['start_time']) && !empty($param['end_time'])){ + $query->where('start_time', '>=', $param['start_time'])->where('start_time', '<=', $param['end_time']); + } + }; $count = $this->field('id') - ->where(function ($query) use($param) { - if(!empty($param['keywords'])){ - $query->where('id|description', 'like', "%{$param['keywords']}%"); - } - if(!empty($param['status'])){ - $query->where('status', $param['status']); - } - }) + ->where($where) ->count(); $tasks = $this->field('id,description,status,retry,start_time,finish_time,fail_reason') - ->where(function ($query) use($param) { - if(!empty($param['keywords'])){ - $query->where('id|description', 'like', "%{$param['keywords']}%"); - } - if(!empty($param['status'])){ - $query->where('status', $param['status']); - } - }) + ->where($where) ->limit($param['limit']) ->page($param['page']) ->order($param['orderby'], $param['sort']) diff --git a/10.2.2/app/common/model/TaskWaitModel.php b/10.2.5/app/common/model/TaskWaitModel.php similarity index 100% rename from 10.2.2/app/common/model/TaskWaitModel.php rename to 10.2.5/app/common/model/TaskWaitModel.php diff --git a/10.2.2/app/common/model/TransactionModel.php b/10.2.5/app/common/model/TransactionModel.php similarity index 89% rename from 10.2.2/app/common/model/TransactionModel.php rename to 10.2.5/app/common/model/TransactionModel.php index a41c35c7..d2667795 100644 --- a/10.2.2/app/common/model/TransactionModel.php +++ b/10.2.5/app/common/model/TransactionModel.php @@ -1,6 +1,7 @@ where('t.order_id', $param['order_id']); + } + if(!empty($param['client_id'])){ + $query->where('t.client_id', $param['client_id']); + } + if(!empty($param['keywords'])){ + $query->where('t.transaction_number|t.order_id|c.username|c.email|c.phone', 'like', "%{$param['keywords']}%"); + } + if(!empty($param['amount'])){ + $query->where('t.amount', 'like', "%{$param['amount']}%"); + } + if(!empty($param['gateway'])){ + $query->where('t.gateway', $param['gateway']); + } + if(!empty($param['start_time']) && !empty($param['end_time'])){ + $query->where('t.create_time', '>=', $param['start_time'])->where('t.create_time', '<=', $param['end_time']); + } + }; $count = $this->alias('t') ->field('t.id') ->leftjoin('client c', 'c.id=t.client_id') - ->where(function ($query) use($param) { - if(!empty($param['order_id'])){ - $query->where('t.order_id', $param['order_id']); - } - if(!empty($param['client_id'])){ - $query->where('t.client_id', $param['client_id']); - } - if(!empty($param['keywords'])){ - $query->where('t.transaction_number|t.order_id|c.username|c.email|c.phone', 'like', "%{$param['keywords']}%"); - } - if(!empty($param['gateway'])){ - $query->where('t.gateway', $param['gateway']); - } - }) + ->where($where) ->count(); $transactions = $this->alias('t') ->field('t.id,t.amount,t.gateway_name gateway,t.transaction_number,t.client_id,c.username client_name,c.email,c.phone_code,c.phone,c.company,t.order_id,t.create_time,o.type') ->leftjoin('client c', 'c.id=t.client_id') ->leftjoin('order o', 'o.id=t.order_id') - ->where(function ($query) use($param) { - if(!empty($param['order_id'])){ - $query->where('t.order_id', $param['order_id']); - } - if(!empty($param['client_id'])){ - $query->where('t.client_id', $param['client_id']); - } - if(!empty($param['keywords'])){ - $query->where('t.transaction_number|t.order_id|c.username|c.email|c.phone', 'like', "%{$param['keywords']}%"); - } - if(!empty($param['gateway'])){ - $query->where('t.gateway', $param['gateway']); - } - }) + ->where($where) ->limit($param['limit']) ->page($param['page']) ->order($param['orderby'], $param['sort']) diff --git a/10.2.2/app/common/model/UpgradeModel.php b/10.2.5/app/common/model/UpgradeModel.php similarity index 100% rename from 10.2.2/app/common/model/UpgradeModel.php rename to 10.2.5/app/common/model/UpgradeModel.php diff --git a/10.2.2/app/common/model/UpstreamHostModel.php b/10.2.5/app/common/model/UpstreamHostModel.php similarity index 58% rename from 10.2.2/app/common/model/UpstreamHostModel.php rename to 10.2.5/app/common/model/UpstreamHostModel.php index ef02697a..4c625e18 100644 --- a/10.2.2/app/common/model/UpstreamHostModel.php +++ b/10.2.5/app/common/model/UpstreamHostModel.php @@ -85,7 +85,51 @@ public function indexHost($id) return (object)[]; } - $res = idcsmart_api_curl($host['supplier_id'], 'console/v1/host/'.$host['upstream_host_id'], [], 30, 'GET'); + $HostModel = new HostModel(); + $hostInit = $HostModel->find($id); + + $UpstreamProductModel = new UpstreamProductModel(); + $upstreamProduct = $UpstreamProductModel->where('supplier_id',$host['supplier_id']) + ->where('product_id',$hostInit['product_id']) + ->find(); + if (isset($upstreamProduct['res_module']) && $upstreamProduct['res_module']=='mf_finance'){ + $res = idcsmart_api_curl($host['supplier_id'], 'host/header', ['host_id'=>$host['upstream_host_id']], 30, 'GET'); + if ($res['status']==200){ + $hostData = $res['data']['host_data']??[]; + $res['data']['host'] = [ + 'active_time' => $hostData['regdate'], + 'agent' => 1, + 'billing_cycle'=>$hostData['billingcycle'], + 'billing_cycle_name'=>$hostData['billingcycle_desc'], + 'billing_cycle_time'=>0, + 'client_notes'=>$hostData['remark'], + 'due_time'=>$hostData['nextduedate'], + 'first_payment_amount'=>$hostData['firstpaymentamount'], + 'id'=>$hostData['id'], + 'name'=>$hostData['domain'], + 'notes'=>$hostData['remark'], + 'product_id'=>$hostData['productid'], + 'product_name'=>$hostData['productname'], + 'renew_amount'=>$hostData['amount'], + 'server_id'=>$hostData['dcimid'], + 'status'=>$hostData['domainstatus'], + 'suspend_reason'=>$hostData['suspendreason'], + 'suspend_type'=>$hostData['suspendreason_type'], + ]; + $res['data']['status'] = [ + 'Unpaid', + 'Pending', + 'Active', + 'Suspended', + 'Deleted', + 'Failed', + 'Cancelled' + ]; + } + }else{ + $res = idcsmart_api_curl($host['supplier_id'], 'console/v1/host/'.$host['upstream_host_id'], [], 30, 'GET'); + } + if(!isset($res['data'])){ return (object)[]; } diff --git a/10.2.2/app/common/model/UpstreamOrderModel.php b/10.2.5/app/common/model/UpstreamOrderModel.php similarity index 100% rename from 10.2.2/app/common/model/UpstreamOrderModel.php rename to 10.2.5/app/common/model/UpstreamOrderModel.php diff --git a/10.2.2/app/common/model/UpstreamProductModel.php b/10.2.5/app/common/model/UpstreamProductModel.php similarity index 73% rename from 10.2.2/app/common/model/UpstreamProductModel.php rename to 10.2.5/app/common/model/UpstreamProductModel.php index d2ac2fd8..2aeabcda 100644 --- a/10.2.2/app/common/model/UpstreamProductModel.php +++ b/10.2.5/app/common/model/UpstreamProductModel.php @@ -115,22 +115,21 @@ public function createProduct($param) // 从上游商品详情拉取 $UpstreamLogic = new UpstreamLogic(); - $res = $UpstreamLogic->upstreamProductDetail(['url' => $supplier['url'], 'id' => $param['upstream_product_id']]); + $res = $UpstreamLogic->upstreamProductDetail(['type' => $supplier['type'], 'url' => $supplier['url'], 'id' => $param['upstream_product_id']]); if(empty($res['data'])){ return ['status'=>400,'msg'=>lang('upstream_product_is_not_exist')]; } - $exist = $this->where('upstream_product_id', $param['upstream_product_id'])->find(); + $exist = $this->where('supplier_id', $param['supplier_id'])->where('upstream_product_id', $param['upstream_product_id'])->find(); if($exist){ return ['status'=>400,'msg'=>lang('agent_product_cannot_repeat_agent')]; } - $resource = $UpstreamLogic->upstreamProductDownloadResource(['url' => $supplier['url'], 'id' => $param['upstream_product_id']]); + $resource = $UpstreamLogic->upstreamProductDownloadResource(['type' => $supplier['type'], 'url' => $supplier['url'], 'id' => $param['upstream_product_id']]); if($resource['status']==400){ return ['status'=>400, 'msg'=>$resource['msg']]; } - $this->startTrans(); try{ $maxOrder = ProductModel::max('order'); @@ -197,23 +196,24 @@ public function updateProduct($param) // 从上游商品详情拉取 $UpstreamLogic = new UpstreamLogic(); - $res = $UpstreamLogic->upstreamProductDetail(['url' => $supplier['url'], 'id' => $param['upstream_product_id']]); + $res = $UpstreamLogic->upstreamProductDetail(['type' => $supplier['type'], 'url' => $supplier['url'], 'id' => $param['upstream_product_id']]); if(empty($res['data'])){ return ['status'=>400,'msg'=>lang('upstream_product_is_not_exist')]; } - $exist = $this->where('upstream_product_id', $param['upstream_product_id'])->where('product_id', '<>', $param['id'])->find(); + $exist = $this->where('supplier_id', $param['supplier_id'])->where('upstream_product_id', $param['upstream_product_id'])->where('product_id', '<>', $param['id'])->find(); if($exist){ return ['status'=>400,'msg'=>lang('agent_product_cannot_repeat_agent')]; } - $resource = $UpstreamLogic->upstreamProductDownloadResource(['url' => $supplier['url'], 'id' => $param['upstream_product_id']]); + $resource = $UpstreamLogic->upstreamProductDownloadResource(['type' => $supplier['type'], 'url' => $supplier['url'], 'id' => $param['upstream_product_id']]); if($resource['status']==400){ return ['status'=>400, 'msg'=>$resource['msg']]; } $upstreamProduct = $this->where('product_id', $param['id'])->find(); $upstreamProduct = $upstreamProduct->toArray(); + $upstreamProduct['id'] = $product['id']; $upstreamProduct['name'] = $product['name']; $upstreamProduct['auto_setup'] = $product['auto_setup']; # 日志描述 @@ -279,21 +279,80 @@ public function agentRecommendProduct($param) return ['status'=>400,'msg'=>lang('recommend_product_is_not_exist')]; } - $exist = $this->where('upstream_product_id', $res['data']['upstream_product_id'])->find(); - if($exist){ - return ['status'=>400,'msg'=>lang('agent_product_cannot_repeat_agent')]; - } + - $resource = $UpstreamLogic->upstreamProductDownloadResource(['url' => $res['data']['url'], 'id' => $res['data']['upstream_product_id']]); + $resource = $UpstreamLogic->upstreamProductDownloadResource(['type' => $res['data']['type'] ?? 'default', 'url' => $res['data']['url'], 'id' => $res['data']['upstream_product_id']]); if($resource['status']==400){ return ['status'=>400, 'msg'=>$resource['msg']]; } $supplier = SupplierModel::where('url', $res['data']['url'])->find(); + if(!empty($supplier)){ + $exist = $this->where('supplier_id', $supplier['id'])->where('upstream_product_id', $res['data']['upstream_product_id'])->find(); + if($exist){ + return ['status'=>400,'msg'=>lang('agent_product_cannot_repeat_agent')]; + } + } + $param['type'] = 'default'; + if($param['type']=='whmcs'){ + $param['secret'] = '-----BEGIN PRIVATE KEY----- +MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQC6f8yTpySPyw+X +u0dQnBQYu4xCOV30HV3ZvpiPtANb7OWj+DsxRF2uidtL1GWHmAzJaa6Mq41FdP2l +WNr5o9BidExb55TDAAxWS3KUODoOvX6guqVDmN3eHw7ssFhCs704gKkQY62aL7hW +RuzOEykV71O+afMQ4cZg8NxE7ce0KwrD5uuqIXo0W6OrdXgq1t46W2OJU5AKbGEh +H/vHn9DONOlmIWnwFXjaoiOvl9ulzZQ1te5mMhu4smTkn7+xxjF/5ruQClTxzmrZ +uQ9s6JGqIewj4qktMPymsamz/7ZuLXAcTTMIfWeQtn74BmZ2vbx6uHHqTv2DY9ed +llPC/zcV1npEP1EiA+yGAi1qEGp3yTy+yCIv1ucwm+qbfvhHtcpOAltICs0rOmUA +NPsFNyjTDxERbxs4/XlCaFAPrejAUik0Eolf9ysKpXJwsrt+OIs8r3aW7+DY2+xA +tevYP+EOWCVfk6g6mVo0vEG5GJAiG1mD+yJbHYlbKVWXP5WdRlaw7esXmHHrAwYA +rnWM6U0NextunItco/v8wcwCJHKJTDRlZPkZaaQaJS7q5vxnCZ7YgpXjh3beJW4X +kf416xuF3edndQsrKaVS34f5tHxZMsFApPYYI7NgsAO+Y11iVGsPb9DvvvMz2Ynn +y0RQjWa6orIM5V4NLrGwZkSpVW33tQIDAQABAoICAB8p0b5udH6OmNlq0tzWZ8lG +NYavXVK4QYFsBsQkeVc3+5ttlD6ERP8wS/Oc1yZUMvbI8QDSfbW4edXSRizmwaBh +/Ixy4vm+nVEiJFA+IP1rjqg+5/Smq5Q9LlpAkU78B8dUQGvbrBuSk8Pe8BzzOK9Q +oXa074fHokV6mePus6sYciEQChsQowHyuiOhamYGJ3Yq5TQCQZRsTcKiPIk73EFI +uCN3u+MBQ4ONCleCEZLgCj77Wo27G8S+EnvdccO78XOE05ybDVymeFZPRROWvRhn +uLS6YDiL8fvMviW0ugApGY2xHLDze4XD6O167E41IDSFc4uKjXQSD+pmPzLbQJHd +JgbVeOTBsev4LhGHLJNqHUH6elIbddyt4aI01P/6dDjpHqN+vHA4oVyVIDFcBDQq +3wnJkIpxdovnYEuw+FtAuwRnEpGWkLiLWm9DydRRu6ONIkpK8K6oChrqUB5dMk7F +nXj9G68BLScydHN8YPTk7XUEJKhzi8uxeyRwM7pPy8sj1sd4MqhcO62XJu/AJdBK +hS2RR+5/pJOKjj0uCgSRkplDUm0gOYEPKMmkJ12uh6MfF8308760d5zP+6w5B2ei +sCMu96pjNgaSW2uVXBp+3z1hpTPgcAuZSmzL99j7Qq5ZKRAmTDJuH5ClC8aRbOv3 +/RjTrx/6d6rCJUxLwQL1AoIBAQDzRhRUz5ceYNOV7XwMC+Wq9Ry7kUOTOBAtMvhd +lop8xHurKtWDOcuH9ZEWJRoZ1CqfGaP7oZ8VcVW2bD/sq5iXPBXDkYNDmrxHakQW +E3/5jsxUWhNSxTj0Nvr8GJKzpgihOsrUVxYWgDDdrA/6+O1xcvhatPkOagimzCIL +suihRMe7vuA9oGterRtQl6oCVA3JGry3iV0pwgz9IspAoAPrrYCxUkBkP0uszq5m +j8RhBXRKybTmDyVft6DFrd8KcHAUsA8N8XLOYWSt03sizhsBdBSVH3YGnPMsVY8T +wriSkRTQT47LyLDD+kU+tXdq+5ZgI1HdpG/wOrYcsD9NpJp/AoIBAQDEQWVAGFdi +ONV2XvsmMXyGemfG2WybxNEw4NNAob/ajVom8y+F0u++XgNpb7oQpbOEKMi5P0yT +XDaFVDS2me7IOKtWxtlJBzLB6/eif4x1LLSZKENAd0tzdeYU1KKUj3XU7S9lIv56 +8lF9ZFA9oUZW25U+cGh7ochwkGEXLMZgJwuLkVZaXwhOP9cQYi2i1tu74VIzzK40 +v5/i6nIpdRfFxKir/cyXvdekTfvRupnfD1AA1x8RM0Wo4bRn1CgbhD2YOT3qD6jo +Q9GSalIuef/A6WTM2Z0Ao8lsoVlPWvZcVWr/1PGY8lgEPSq0edFqVnGjtdItqrUr +BgPySgrEvAvLAoIBAD/DzKx2RSwHQS55MxyNOcPXv5JCfy3lcggG5ibRwLb3YVr6 +PUDKM1kNutvNGcxPWmSdeegI8wPR0x+fvBmy2Ko7a5D5YSilNFibuAD5V3/4OAKc +IZh+bXFFv/+4CSvhhz2LhYKm2PlI3IYeBYpJGSO1ePd9nBJ1JJNjykC6wlMTDi9d +1rUQiVQll5VGS5+UnJBr269X5/18CZ+IMO9DggOSVLslzg74sEM5YWksodK0dUjt +Ged7bNZr8U4fRukbk6U4iJmlAeyqhpMxbYMv9tAotwRnXK5bETo7qucJEQwJzyTS +1aEAl6SmwuOu+QAntcC5QUoRQe371aQrZkxZqs0CggEASy9Obb6lg3CIfp+mkZw1 +u4MbTLew/v/osFQBOmp9CGpMlk1l8Fu+Eu0LW5I88vG4EzJYq3dPi8iw7mUzCJ1y +N+xV35mwVmTWkionJW69zYoB6gbdtM2+7w3ExkgrvMQ0/Qycsp80ZL9+bo5Gm0W0 +n8PhqhkAPhTdqBn3yBwUJ3Pt3VshfN+ZW/jjGFi0aQTtC04n4sZQGs8qnpD4iV9d +axuLDtDdV2iYO07Q4Skel7DTEm9XbIx67FcDeR9y+g+wVSfgy1GSgOCyYegvcbS1 +QR9oyX24wyz8Foy9nUQYy4jBxB69K73z8DPKr3dXveg+Aty+F1alr0TPsDujYnkz +/wKCAQBPiGp4P5EytBpxp3sXW/k6KXLXBaALIuc/ib1r6hz6wdGlBlJLdUNzwvNi +Upg39NExLREKQPiwxwiXQ9twIY/dXEUvn5QaC9NVeM1tm/ciwfug/jmkKhpqHSHs ++RkEmcomqpx5bDfAxwL3v67xMykSMsRUm84VQ9RmIzUqDxyD6KJt+1KrUU5HTBew +dlAimSBOmDofTVE5lNXqx49fB3OzzWrLGR8PA7RAl9bGgaqUlJV2plU1fitmvyHu +utAb35077ruJC5nMrezGxleVi8IYW4VhHYwdh9oEjdFMi27tqIK63dAOizYNp6he +VIix+jUQp0t+3mbq07+TRxbkbhOc +-----END PRIVATE KEY-----'; + } $this->startTrans(); try{ if(empty($supplier)){ $supplier = SupplierModel::create([ + 'type' => $param['type'], 'name' => $res['data']['supplier_name'], 'url' => $res['data']['url'], 'username' => $param['username'], diff --git a/10.2.2/app/common/validate/UploadValidate.php b/10.2.5/app/common/validate/UploadValidate.php similarity index 100% rename from 10.2.2/app/common/validate/UploadValidate.php rename to 10.2.5/app/common/validate/UploadValidate.php diff --git a/10.2.2/app/event.php b/10.2.5/app/event.php similarity index 100% rename from 10.2.2/app/event.php rename to 10.2.5/app/event.php diff --git a/10.2.2/app/event/AppInit.php b/10.2.5/app/event/AppInit.php similarity index 100% rename from 10.2.2/app/event/AppInit.php rename to 10.2.5/app/event/AppInit.php diff --git a/10.2.2/app/event/controller/AddonController.php b/10.2.5/app/event/controller/AddonController.php similarity index 100% rename from 10.2.2/app/event/controller/AddonController.php rename to 10.2.5/app/event/controller/AddonController.php diff --git a/10.2.2/app/event/controller/AddonHomeController.php b/10.2.5/app/event/controller/AddonHomeController.php similarity index 100% rename from 10.2.2/app/event/controller/AddonHomeController.php rename to 10.2.5/app/event/controller/AddonHomeController.php diff --git a/10.2.2/app/event/controller/BaseController.php b/10.2.5/app/event/controller/BaseController.php similarity index 100% rename from 10.2.2/app/event/controller/BaseController.php rename to 10.2.5/app/event/controller/BaseController.php diff --git a/10.2.2/app/event/controller/CaptchaController.php b/10.2.5/app/event/controller/CaptchaController.php similarity index 100% rename from 10.2.2/app/event/controller/CaptchaController.php rename to 10.2.5/app/event/controller/CaptchaController.php diff --git a/10.2.2/app/event/controller/CertificationController.php b/10.2.5/app/event/controller/CertificationController.php similarity index 100% rename from 10.2.2/app/event/controller/CertificationController.php rename to 10.2.5/app/event/controller/CertificationController.php diff --git a/10.2.2/app/event/controller/CertificationHomeController.php b/10.2.5/app/event/controller/CertificationHomeController.php similarity index 100% rename from 10.2.2/app/event/controller/CertificationHomeController.php rename to 10.2.5/app/event/controller/CertificationHomeController.php diff --git a/10.2.2/app/event/controller/GatewayController.php b/10.2.5/app/event/controller/GatewayController.php similarity index 100% rename from 10.2.2/app/event/controller/GatewayController.php rename to 10.2.5/app/event/controller/GatewayController.php diff --git a/10.2.2/app/event/controller/ModuleController.php b/10.2.5/app/event/controller/ModuleController.php similarity index 100% rename from 10.2.2/app/event/controller/ModuleController.php rename to 10.2.5/app/event/controller/ModuleController.php diff --git a/10.2.2/app/event/controller/ModuleHomeController.php b/10.2.5/app/event/controller/ModuleHomeController.php similarity index 100% rename from 10.2.2/app/event/controller/ModuleHomeController.php rename to 10.2.5/app/event/controller/ModuleHomeController.php diff --git a/10.2.2/app/event/controller/PluginAdminBaseController.php b/10.2.5/app/event/controller/PluginAdminBaseController.php similarity index 100% rename from 10.2.2/app/event/controller/PluginAdminBaseController.php rename to 10.2.5/app/event/controller/PluginAdminBaseController.php diff --git a/10.2.2/app/event/controller/PluginBaseController.php b/10.2.5/app/event/controller/PluginBaseController.php similarity index 100% rename from 10.2.2/app/event/controller/PluginBaseController.php rename to 10.2.5/app/event/controller/PluginBaseController.php diff --git a/10.2.2/app/exception/TemplateNotFoundException.php b/10.2.5/app/exception/TemplateNotFoundException.php similarity index 100% rename from 10.2.2/app/exception/TemplateNotFoundException.php rename to 10.2.5/app/exception/TemplateNotFoundException.php diff --git a/10.2.2/app/home/controller/AccountController.php b/10.2.5/app/home/controller/AccountController.php similarity index 100% rename from 10.2.2/app/home/controller/AccountController.php rename to 10.2.5/app/home/controller/AccountController.php diff --git a/10.2.2/app/home/controller/ApiController.php b/10.2.5/app/home/controller/ApiController.php similarity index 100% rename from 10.2.2/app/home/controller/ApiController.php rename to 10.2.5/app/home/controller/ApiController.php diff --git a/10.2.2/app/home/controller/BaseController.php b/10.2.5/app/home/controller/BaseController.php similarity index 100% rename from 10.2.2/app/home/controller/BaseController.php rename to 10.2.5/app/home/controller/BaseController.php diff --git a/10.2.2/app/home/controller/CartController.php b/10.2.5/app/home/controller/CartController.php similarity index 100% rename from 10.2.2/app/home/controller/CartController.php rename to 10.2.5/app/home/controller/CartController.php diff --git a/10.2.2/app/home/controller/CommonController.php b/10.2.5/app/home/controller/CommonController.php similarity index 96% rename from 10.2.2/app/home/controller/CommonController.php rename to 10.2.5/app/home/controller/CommonController.php index 0af46dbb..2df5ae9a 100644 --- a/10.2.2/app/home/controller/CommonController.php +++ b/10.2.5/app/home/controller/CommonController.php @@ -212,6 +212,13 @@ public function gateway() * @return string enterprise_mailbox - 企业邮箱 * @return string enterprise_qrcode - 企业二维码 * @return string online_customer_service_link - 在线客服链接 + * @return string icp_info - ICP信息 + * @return string icp_info_link - ICP信息信息链接 + * @return string public_security_network_preparation - 公安网备 + * @return string public_security_network_preparation_link - 公安网备链接 + * @return string telecom_appreciation - 电信增值 + * @return string copyright_info - 版权信息 + * @return string official_website_logo - 官网LOGO * @return array feedback_type - 意见反馈类型 * @return int feedback_type[].id - 意见反馈类型ID * @return string feedback_type[].name - 名称 @@ -265,6 +272,13 @@ public function common() 'enterprise_mailbox', 'enterprise_qrcode', 'online_customer_service_link', + 'icp_info', + 'icp_info_link', + 'public_security_network_preparation', + 'public_security_network_preparation_link', + 'telecom_appreciation', + 'copyright_info', + 'official_website_logo', ]; //$data = configuration($setting); diff --git a/10.2.2/app/home/controller/HomeBaseController.php b/10.2.5/app/home/controller/HomeBaseController.php similarity index 100% rename from 10.2.2/app/home/controller/HomeBaseController.php rename to 10.2.5/app/home/controller/HomeBaseController.php diff --git a/10.2.2/app/home/controller/HooksController.php b/10.2.5/app/home/controller/HooksController.php similarity index 100% rename from 10.2.2/app/home/controller/HooksController.php rename to 10.2.5/app/home/controller/HooksController.php diff --git a/10.2.2/app/home/controller/HostController.php b/10.2.5/app/home/controller/HostController.php similarity index 100% rename from 10.2.2/app/home/controller/HostController.php rename to 10.2.5/app/home/controller/HostController.php diff --git a/10.2.2/app/home/controller/IndexController.php b/10.2.5/app/home/controller/IndexController.php similarity index 100% rename from 10.2.2/app/home/controller/IndexController.php rename to 10.2.5/app/home/controller/IndexController.php diff --git a/10.2.2/app/home/controller/LogController.php b/10.2.5/app/home/controller/LogController.php similarity index 100% rename from 10.2.2/app/home/controller/LogController.php rename to 10.2.5/app/home/controller/LogController.php diff --git a/10.2.2/app/home/controller/LoginController.php b/10.2.5/app/home/controller/LoginController.php similarity index 100% rename from 10.2.2/app/home/controller/LoginController.php rename to 10.2.5/app/home/controller/LoginController.php diff --git a/10.2.2/app/home/controller/ModuleController.php b/10.2.5/app/home/controller/ModuleController.php similarity index 100% rename from 10.2.2/app/home/controller/ModuleController.php rename to 10.2.5/app/home/controller/ModuleController.php diff --git a/10.2.2/app/home/controller/OrderController.php b/10.2.5/app/home/controller/OrderController.php similarity index 100% rename from 10.2.2/app/home/controller/OrderController.php rename to 10.2.5/app/home/controller/OrderController.php diff --git a/10.2.2/app/home/controller/PayController.php b/10.2.5/app/home/controller/PayController.php similarity index 100% rename from 10.2.2/app/home/controller/PayController.php rename to 10.2.5/app/home/controller/PayController.php diff --git a/10.2.2/app/home/controller/ProductController.php b/10.2.5/app/home/controller/ProductController.php similarity index 100% rename from 10.2.2/app/home/controller/ProductController.php rename to 10.2.5/app/home/controller/ProductController.php diff --git a/10.2.2/app/home/controller/TransactionController.php b/10.2.5/app/home/controller/TransactionController.php similarity index 100% rename from 10.2.2/app/home/controller/TransactionController.php rename to 10.2.5/app/home/controller/TransactionController.php diff --git a/10.2.2/app/home/controller/UpstreamController.php b/10.2.5/app/home/controller/UpstreamController.php similarity index 100% rename from 10.2.2/app/home/controller/UpstreamController.php rename to 10.2.5/app/home/controller/UpstreamController.php diff --git a/10.2.2/app/home/controller/ViewController.php b/10.2.5/app/home/controller/ViewController.php similarity index 95% rename from 10.2.2/app/home/controller/ViewController.php rename to 10.2.5/app/home/controller/ViewController.php index 1c1ed366..02e83eb4 100644 --- a/10.2.2/app/home/controller/ViewController.php +++ b/10.2.5/app/home/controller/ViewController.php @@ -27,8 +27,9 @@ public function index() } if($tplName=='index'){ - header('location:/theme/index.html');die; - $view_path = '../public/theme/'; + $view_path = '../public/clientarea/template/'.$data['themes'].'/'; + //header('location:/theme/index.html');die; + //$view_path = '../public/theme/'; }else{ $view_path = '../public/clientarea/template/'.$data['themes'].'/'; } diff --git a/10.2.2/app/home/model/CartModel.php b/10.2.5/app/home/model/CartModel.php similarity index 96% rename from 10.2.2/app/home/model/CartModel.php rename to 10.2.5/app/home/model/CartModel.php index cc7c2e92..efa58f54 100644 --- a/10.2.2/app/home/model/CartModel.php +++ b/10.2.5/app/home/model/CartModel.php @@ -528,6 +528,7 @@ public function settle($position,$customfield=[],$param=[]) ]); $ResModuleLogic = new ResModuleLogic($upstreamProduct); $result = $ResModuleLogic->afterSettle($product, $host->id, $value['config_options']); + }else{ $ModuleLogic->afterSettle($product, $host->id, $value['config_options']); } @@ -535,6 +536,16 @@ public function settle($position,$customfield=[],$param=[]) // 产品和对应自定义字段 $customfield['host_customfield'][] = ['id'=>$host->id, 'customfield' => $value['customfield'] ?? []]; + //$des = $product['name'] . '(' .$host['name']. '),购买时长:'.$host['billing_cycle_name'] .'(' . date('Y/m/d H',$host['active_time']) . '-'. date('Y/m/d H',$host['active_time']) .')'; + if (in_array($host['billing_cycle'],['onetime','free'])){ + $desDueTime = '∞'; + }else{ + $desDueTime = date('Y/m/d',time() + intval($host['billing_cycle_time'])); + //$desDueTime = date('Y/m/d',$host['active_time']); + } + $des = lang('order_description_append',['{product_name}'=>$product['name'],'{name}'=>$host['name'],'{billing_cycle_name}'=>$host['billing_cycle_name'],'{time}'=>date('Y/m/d',$host['active_time']) . '-' . $desDueTime]); + + $orderItem[] = [ 'order_id' => $order->id, 'client_id' => $clientId, @@ -543,7 +554,7 @@ public function settle($position,$customfield=[],$param=[]) 'type' => 'host', 'rel_id' => $host->id, 'amount' => $value['price'], - 'description' => $value['description'], + 'description' => $value['description'] . "\n" . $des, 'create_time' => $time, ]; } diff --git a/10.2.2/app/home/model/ClientareaAuthModel.php b/10.2.5/app/home/model/ClientareaAuthModel.php similarity index 100% rename from 10.2.2/app/home/model/ClientareaAuthModel.php rename to 10.2.5/app/home/model/ClientareaAuthModel.php diff --git a/10.2.2/app/home/model/ClientareaAuthRuleLinkModel.php b/10.2.5/app/home/model/ClientareaAuthRuleLinkModel.php similarity index 100% rename from 10.2.2/app/home/model/ClientareaAuthRuleLinkModel.php rename to 10.2.5/app/home/model/ClientareaAuthRuleLinkModel.php diff --git a/10.2.2/app/home/model/ClientareaAuthRuleModel.php b/10.2.5/app/home/model/ClientareaAuthRuleModel.php similarity index 100% rename from 10.2.2/app/home/model/ClientareaAuthRuleModel.php rename to 10.2.5/app/home/model/ClientareaAuthRuleModel.php diff --git a/10.2.2/app/home/validate/AccountValidate.php b/10.2.5/app/home/validate/AccountValidate.php similarity index 100% rename from 10.2.2/app/home/validate/AccountValidate.php rename to 10.2.5/app/home/validate/AccountValidate.php diff --git a/10.2.2/app/home/validate/ApiValidate.php b/10.2.5/app/home/validate/ApiValidate.php similarity index 100% rename from 10.2.2/app/home/validate/ApiValidate.php rename to 10.2.5/app/home/validate/ApiValidate.php diff --git a/10.2.2/app/home/validate/CartValidate.php b/10.2.5/app/home/validate/CartValidate.php similarity index 100% rename from 10.2.2/app/home/validate/CartValidate.php rename to 10.2.5/app/home/validate/CartValidate.php diff --git a/10.2.2/app/home/validate/CommonValidate.php b/10.2.5/app/home/validate/CommonValidate.php similarity index 100% rename from 10.2.2/app/home/validate/CommonValidate.php rename to 10.2.5/app/home/validate/CommonValidate.php diff --git a/10.2.2/app/home/validate/ConsultValidate.php b/10.2.5/app/home/validate/ConsultValidate.php similarity index 100% rename from 10.2.2/app/home/validate/ConsultValidate.php rename to 10.2.5/app/home/validate/ConsultValidate.php diff --git a/10.2.2/app/home/validate/FeedbackValidate.php b/10.2.5/app/home/validate/FeedbackValidate.php similarity index 100% rename from 10.2.2/app/home/validate/FeedbackValidate.php rename to 10.2.5/app/home/validate/FeedbackValidate.php diff --git a/10.2.2/app/home/validate/HostValidate.php b/10.2.5/app/home/validate/HostValidate.php similarity index 100% rename from 10.2.2/app/home/validate/HostValidate.php rename to 10.2.5/app/home/validate/HostValidate.php diff --git a/10.2.2/app/home/validate/ProductValidate.php b/10.2.5/app/home/validate/ProductValidate.php similarity index 100% rename from 10.2.2/app/home/validate/ProductValidate.php rename to 10.2.5/app/home/validate/ProductValidate.php diff --git a/10.2.2/app/http/middleware/Check.php b/10.2.5/app/http/middleware/Check.php similarity index 100% rename from 10.2.2/app/http/middleware/Check.php rename to 10.2.5/app/http/middleware/Check.php diff --git a/10.2.2/app/http/middleware/CheckAdmin.php b/10.2.5/app/http/middleware/CheckAdmin.php similarity index 100% rename from 10.2.2/app/http/middleware/CheckAdmin.php rename to 10.2.5/app/http/middleware/CheckAdmin.php diff --git a/10.2.2/app/http/middleware/CheckHome.php b/10.2.5/app/http/middleware/CheckHome.php similarity index 100% rename from 10.2.2/app/http/middleware/CheckHome.php rename to 10.2.5/app/http/middleware/CheckHome.php diff --git a/10.2.2/app/http/middleware/ParamFilter.php b/10.2.5/app/http/middleware/ParamFilter.php similarity index 100% rename from 10.2.2/app/http/middleware/ParamFilter.php rename to 10.2.5/app/http/middleware/ParamFilter.php diff --git a/10.2.2/app/middleware.php b/10.2.5/app/middleware.php similarity index 100% rename from 10.2.2/app/middleware.php rename to 10.2.5/app/middleware.php diff --git a/10.2.2/config/app.php b/10.2.5/config/app.php similarity index 100% rename from 10.2.2/config/app.php rename to 10.2.5/config/app.php diff --git a/10.2.2/config/cache.php b/10.2.5/config/cache.php similarity index 100% rename from 10.2.2/config/cache.php rename to 10.2.5/config/cache.php diff --git a/10.2.2/config/captcha.php b/10.2.5/config/captcha.php similarity index 100% rename from 10.2.2/config/captcha.php rename to 10.2.5/config/captcha.php diff --git a/10.2.2/config/console.php b/10.2.5/config/console.php similarity index 100% rename from 10.2.2/config/console.php rename to 10.2.5/config/console.php diff --git a/10.2.2/config/cookie.php b/10.2.5/config/cookie.php similarity index 100% rename from 10.2.2/config/cookie.php rename to 10.2.5/config/cookie.php diff --git a/10.2.2/config/database.php b/10.2.5/config/database.php similarity index 100% rename from 10.2.2/config/database.php rename to 10.2.5/config/database.php diff --git a/10.2.2/config/filesystem.php b/10.2.5/config/filesystem.php similarity index 100% rename from 10.2.2/config/filesystem.php rename to 10.2.5/config/filesystem.php diff --git a/10.2.2/config/idcsmart.php b/10.2.5/config/idcsmart.php similarity index 100% rename from 10.2.2/config/idcsmart.php rename to 10.2.5/config/idcsmart.php diff --git a/10.2.2/config/lang.php b/10.2.5/config/lang.php similarity index 100% rename from 10.2.2/config/lang.php rename to 10.2.5/config/lang.php diff --git a/10.2.2/config/log.php b/10.2.5/config/log.php similarity index 100% rename from 10.2.2/config/log.php rename to 10.2.5/config/log.php diff --git a/10.2.2/config/middleware.php b/10.2.5/config/middleware.php similarity index 100% rename from 10.2.2/config/middleware.php rename to 10.2.5/config/middleware.php diff --git a/10.2.2/config/route.php b/10.2.5/config/route.php similarity index 100% rename from 10.2.2/config/route.php rename to 10.2.5/config/route.php diff --git a/10.2.2/config/session.php b/10.2.5/config/session.php similarity index 100% rename from 10.2.2/config/session.php rename to 10.2.5/config/session.php diff --git a/10.2.2/config/trace.php b/10.2.5/config/trace.php similarity index 100% rename from 10.2.2/config/trace.php rename to 10.2.5/config/trace.php diff --git a/10.2.2/config/view.php b/10.2.5/config/view.php similarity index 100% rename from 10.2.2/config/view.php rename to 10.2.5/config/view.php diff --git a/10.2.2/cron/cron.php b/10.2.5/cron/cron.php similarity index 100% rename from 10.2.2/cron/cron.php rename to 10.2.5/cron/cron.php diff --git a/10.2.2/cron/task.php b/10.2.5/cron/task.php similarity index 100% rename from 10.2.2/cron/task.php rename to 10.2.5/cron/task.php diff --git a/10.2.2/public/.htaccess b/10.2.5/public/.htaccess similarity index 100% rename from 10.2.2/public/.htaccess rename to 10.2.5/public/.htaccess diff --git a/10.2.2/public/503.html b/10.2.5/public/503.html similarity index 100% rename from 10.2.2/public/503.html rename to 10.2.5/public/503.html diff --git a/10.2.2/public/Desktop.ini b/10.2.5/public/Desktop.ini similarity index 100% rename from 10.2.2/public/Desktop.ini rename to 10.2.5/public/Desktop.ini diff --git a/10.2.2/public/admin/index.php b/10.2.5/public/admin/index.php similarity index 100% rename from 10.2.2/public/admin/index.php rename to 10.2.5/public/admin/index.php diff --git a/10.2.2/public/admin/language/en-us.js b/10.2.5/public/admin/language/en-us.js similarity index 100% rename from 10.2.2/public/admin/language/en-us.js rename to 10.2.5/public/admin/language/en-us.js diff --git a/10.2.2/public/admin/language/en-us.php b/10.2.5/public/admin/language/en-us.php similarity index 100% rename from 10.2.2/public/admin/language/en-us.php rename to 10.2.5/public/admin/language/en-us.php diff --git a/10.2.2/public/admin/language/zh-cn.js b/10.2.5/public/admin/language/zh-cn.js similarity index 100% rename from 10.2.2/public/admin/language/zh-cn.js rename to 10.2.5/public/admin/language/zh-cn.js diff --git a/10.2.2/public/admin/language/zh-cn.php b/10.2.5/public/admin/language/zh-cn.php similarity index 97% rename from 10.2.2/public/admin/language/zh-cn.php rename to 10.2.5/public/admin/language/zh-cn.php index 1b6688d1..0bb62da6 100644 --- a/10.2.2/public/admin/language/zh-cn.php +++ b/10.2.5/public/admin/language/zh-cn.php @@ -1064,4 +1064,26 @@ 'partner_name_cannot_exceed_100_chars' => '名称不能超过100个字符', 'please_select_partner_image' => '请选择图片', 'please_enter_partner_description' => '请输入描述', + 'icp_info_require' => '请输入ICP信息', + 'icp_info_max' => 'ICP信息不能超过255个字符', + 'icp_info_link_require' => '请输入ICP信息跳转链接', + 'icp_info_link_max' => 'ICP信息跳转链接不能超过255个字符', + 'icp_info_link_error' => 'ICP信息跳转链接地址格式错误', + 'public_security_network_preparation_require' => '请输入公安网备', + 'public_security_network_preparation_max' => '公安网备不能超过255个字符', + 'public_security_network_preparation_link_require' => '请输入公安网备跳转链接', + 'public_security_network_preparation_link_max' => '公安网备跳转链接不能超过255个字符', + 'public_security_network_preparation_link_error' => '公安网备跳转链接地址格式错误', + 'telecom_appreciation_require' => '请输入电信增值', + 'telecom_appreciation_max' => '电信增值不能超过255个字符', + 'copyright_info_require' => '请输入版权信息', + 'copyright_info_max' => '版权信息不能超过255个字符', + 'official_website_logo_require' => '请上传官网LOGO', + + 'client_record_is_not_exist' => '用户信息记录不存在', + 'client_record_content_cannot_empty' => '内容不能为空', + 'client_record_content_cannot_exceed_300_chars' => '内容不能超过300个字符', + 'client_record_attachment_cannot_empty' => '请选择附件', + + 'order_description_append' => '{product_name}({name}),购买时长:{billing_cycle_name}({time})', ]; diff --git a/10.2.2/public/admin/language/zh-hk.js b/10.2.5/public/admin/language/zh-hk.js similarity index 100% rename from 10.2.2/public/admin/language/zh-hk.js rename to 10.2.5/public/admin/language/zh-hk.js diff --git a/10.2.2/public/admin/language/zh-hk.php b/10.2.5/public/admin/language/zh-hk.php similarity index 100% rename from 10.2.2/public/admin/language/zh-hk.php rename to 10.2.5/public/admin/language/zh-hk.php diff --git a/10.2.2/public/admin/template/default/404.php b/10.2.5/public/admin/template/default/404.php similarity index 100% rename from 10.2.2/public/admin/template/default/404.php rename to 10.2.5/public/admin/template/default/404.php diff --git a/10.2.2/public/admin/template/default/admin.php b/10.2.5/public/admin/template/default/admin.php similarity index 80% rename from 10.2.2/public/admin/template/default/admin.php rename to 10.2.5/public/admin/template/default/admin.php index a9a05a33..00023eae 100644 --- a/10.2.2/public/admin/template/default/admin.php +++ b/10.2.5/public/admin/template/default/admin.php @@ -13,13 +13,19 @@
{{lang.add}} - - + @@ -52,35 +58,35 @@ - + - + - + - + - + - + - + diff --git a/10.2.2/public/admin/template/default/admin_role.php b/10.2.5/public/admin/template/default/admin_role.php similarity index 94% rename from 10.2.2/public/admin/template/default/admin_role.php rename to 10.2.5/public/admin/template/default/admin_role.php index c4863482..a0afa874 100644 --- a/10.2.2/public/admin/template/default/admin_role.php +++ b/10.2.5/public/admin/template/default/admin_role.php @@ -14,7 +14,7 @@
{{lang.add}} @@ -50,10 +50,10 @@ - + - +
diff --git a/10.2.2/public/admin/template/default/agentList.php b/10.2.5/public/admin/template/default/agentList.php similarity index 98% rename from 10.2.2/public/admin/template/default/agentList.php rename to 10.2.5/public/admin/template/default/agentList.php index 10eb988d..d9bb675e 100644 --- a/10.2.2/public/admin/template/default/agentList.php +++ b/10.2.5/public/admin/template/default/agentList.php @@ -77,7 +77,7 @@ - + diff --git a/10.2.2/public/admin/template/default/api/addon.js b/10.2.5/public/admin/template/default/api/addon.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/addon.js rename to 10.2.5/public/admin/template/default/api/addon.js diff --git a/10.2.2/public/admin/template/default/api/childAccount.js b/10.2.5/public/admin/template/default/api/childAccount.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/childAccount.js rename to 10.2.5/public/admin/template/default/api/childAccount.js diff --git a/10.2.2/public/admin/template/default/api/client.js b/10.2.5/public/admin/template/default/api/client.js similarity index 90% rename from 10.2.2/public/admin/template/default/api/client.js rename to 10.2.5/public/admin/template/default/api/client.js index 20e6c4e6..7f99cce7 100644 --- a/10.2.2/public/admin/template/default/api/client.js +++ b/10.2.5/public/admin/template/default/api/client.js @@ -168,7 +168,7 @@ function getproModule(id) { } // 续费页面 function getSingleRenew(id) { - return Axios.get(`/host/${id}/renew`, { id }); + return Axios.get(`/host/${id}/renew`); } // 续费 function postSingleRenew(params) { @@ -298,3 +298,35 @@ function getMoudleBtns(params) { function upHostDetail(id) { return Axios.get(`/upstream/host/${id}`) } + + +/* 个人资料-信息记录 */ + +function getRecordList(params) { + return Axios.get(`/client/${params.id}/record`, { params }) +} +function addAndUpdateRecord(type, params) { + if (type === 'add') { + return Axios.post(`/client/${params.id}/record`, params) + } else if (type === 'update') { + return Axios.put(`/client/record/${params.id}`, params) + } +} +function deleteRecord(params) { + return Axios.delete(`/client/record/${params.id}`) +} + +// 获取支付接口 +function getPayList() { + return Axios.get('/gateway') +} + +// 获取用户自定义字段和值 +function clientCustomDetail(id) { + return Axios.get(`/client/${id}/client_custom_field_value`); +} + +// 获取商品下拉优化插件配置 +function getSelectConfig () { + return Axios.get(`/product_drop_down_select/config`) +} \ No newline at end of file diff --git a/10.2.2/public/admin/template/default/api/common.js b/10.2.5/public/admin/template/default/api/common.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/common.js rename to 10.2.5/public/admin/template/default/api/common.js diff --git a/10.2.2/public/admin/template/default/api/customerService.js b/10.2.5/public/admin/template/default/api/customerService.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/customerService.js rename to 10.2.5/public/admin/template/default/api/customerService.js diff --git a/10.2.2/public/admin/template/default/api/index.js b/10.2.5/public/admin/template/default/api/index.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/index.js rename to 10.2.5/public/admin/template/default/api/index.js diff --git a/10.2.2/public/admin/template/default/api/install.js b/10.2.5/public/admin/template/default/api/install.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/install.js rename to 10.2.5/public/admin/template/default/api/install.js diff --git a/10.2.2/public/admin/template/default/api/invoice.js b/10.2.5/public/admin/template/default/api/invoice.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/invoice.js rename to 10.2.5/public/admin/template/default/api/invoice.js diff --git a/10.2.2/public/admin/template/default/api/manage.js b/10.2.5/public/admin/template/default/api/manage.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/manage.js rename to 10.2.5/public/admin/template/default/api/manage.js diff --git a/10.2.2/public/admin/template/default/api/navigation.js b/10.2.5/public/admin/template/default/api/navigation.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/navigation.js rename to 10.2.5/public/admin/template/default/api/navigation.js diff --git a/10.2.2/public/admin/template/default/api/product.js b/10.2.5/public/admin/template/default/api/product.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/product.js rename to 10.2.5/public/admin/template/default/api/product.js diff --git a/10.2.2/public/admin/template/default/api/rc.js b/10.2.5/public/admin/template/default/api/rc.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/rc.js rename to 10.2.5/public/admin/template/default/api/rc.js diff --git a/10.2.2/public/admin/template/default/api/real_name.js b/10.2.5/public/admin/template/default/api/real_name.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/real_name.js rename to 10.2.5/public/admin/template/default/api/real_name.js diff --git a/10.2.2/public/admin/template/default/api/recording1559.js b/10.2.5/public/admin/template/default/api/recording1559.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/recording1559.js rename to 10.2.5/public/admin/template/default/api/recording1559.js diff --git a/10.2.2/public/admin/template/default/api/setting.js b/10.2.5/public/admin/template/default/api/setting.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/setting.js rename to 10.2.5/public/admin/template/default/api/setting.js diff --git a/10.2.2/public/admin/template/default/api/system.js b/10.2.5/public/admin/template/default/api/system.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/system.js rename to 10.2.5/public/admin/template/default/api/system.js diff --git a/10.2.2/public/admin/template/default/api/upstream.js b/10.2.5/public/admin/template/default/api/upstream.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/upstream.js rename to 10.2.5/public/admin/template/default/api/upstream.js diff --git a/10.2.2/public/admin/template/default/api/withdrawal.js b/10.2.5/public/admin/template/default/api/withdrawal.js similarity index 100% rename from 10.2.2/public/admin/template/default/api/withdrawal.js rename to 10.2.5/public/admin/template/default/api/withdrawal.js diff --git a/10.2.5/public/admin/template/default/captcha.php b/10.2.5/public/admin/template/default/captcha.php new file mode 100644 index 00000000..55d11a71 --- /dev/null +++ b/10.2.5/public/admin/template/default/captcha.php @@ -0,0 +1,126 @@ +{include file="header"} + + +
+ + +
+ {{lang.get_more}} + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ {{lang.hold}} + {{lang.cancel}} +
+
+
+ + + + + + + + + + + + + + +
+ + + +{include file="footer"} \ No newline at end of file diff --git a/10.2.2/public/admin/template/default/childAccount.php b/10.2.5/public/admin/template/default/childAccount.php similarity index 100% rename from 10.2.2/public/admin/template/default/childAccount.php rename to 10.2.5/public/admin/template/default/childAccount.php diff --git a/10.2.2/public/admin/template/default/client.php b/10.2.5/public/admin/template/default/client.php similarity index 89% rename from 10.2.2/public/admin/template/default/client.php rename to 10.2.5/public/admin/template/default/client.php index 2606d6c3..46e1fe17 100644 --- a/10.2.2/public/admin/template/default/client.php +++ b/10.2.5/public/admin/template/default/client.php @@ -9,11 +9,11 @@

@@ -70,7 +70,7 @@ - + - + - + - +
{{lang.hold}} diff --git a/10.2.5/public/admin/template/default/client_detail.php b/10.2.5/public/admin/template/default/client_detail.php new file mode 100644 index 00000000..26f19dda --- /dev/null +++ b/10.2.5/public/admin/template/default/client_detail.php @@ -0,0 +1,305 @@ +{include file="header"} + + + +
+ +
+ {{lang.user_manage}} + + {{lang.user_list}} + + {{lang.personal}} +
+ +
+ + + + #{{data.id}}-{{data.username ? data.username : (data.phone? data.phone: data.email)}} + ({{data.company}}) + + + #{{item.id}}-{{item.username ? item.username : (item.phone? item.phone: item.email)}} + ({{item.company}}) + + +
+
+ +
+ +

账户信息

+
+ + {{lang.Recharge}} + + +
+ {{lang.change_log}} + {{lang.change_log}} +
+
+
+ + + 余额{{thousandth(data.credit)}}{{currency_suffix}} + + + 产品总数{{data.host_num}}个 + + + + + 消费{{thousandth(data.consume)}}{{currency_suffix}} + + + 有效数量{{data.host_active_num}}个 + + + + + 退款{{thousandth(calcRefund)}}{{currency_suffix}} + + + 注册时间{{moment(data.register_time * 1000).format('YYYY-MM-DD HH:mm:ss')}} + + + + + 提现{{thousandth(data.withdraw)}}{{currency_suffix}} + + + 实名状态 +
未实名
+
{{data.username}}({{data.certification_detail.company.company}})
+
{{data.certification_detail.person.card_name}}
+
+
+
+
+ +

登录记录

+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+ {{lang.sure+lang.Recharge}} + {{lang.cancel}} +
+
+
+ + + + + + + + + + + + + + + + +
+ {{lang.submit}} + {{lang.cancel}} +
+
+
+ + +
+ + + + + + + +
+
+ + + + + + + + +
+ + + + +{include file="footer"} \ No newline at end of file diff --git a/10.2.2/public/admin/template/default/client_host.php b/10.2.5/public/admin/template/default/client_host.php similarity index 96% rename from 10.2.2/public/admin/template/default/client_host.php rename to 10.2.5/public/admin/template/default/client_host.php index 0d39e648..f4295898 100644 --- a/10.2.2/public/admin/template/default/client_host.php +++ b/10.2.5/public/admin/template/default/client_host.php @@ -33,8 +33,12 @@
  • {{lang.auto_order}}
  • +
  • + {{lang.info_records}} +
  • - + #{{clientDetail.id}}-{{clientDetail.username ? clientDetail.username : (clientDetail.phone? clientDetail.phone: clientDetail.email)}} ({{clientDetail.company}}) diff --git a/10.2.2/public/admin/template/default/client_log.php b/10.2.5/public/admin/template/default/client_log.php similarity index 96% rename from 10.2.2/public/admin/template/default/client_log.php rename to 10.2.5/public/admin/template/default/client_log.php index 9cff6b88..1ff309ab 100644 --- a/10.2.2/public/admin/template/default/client_log.php +++ b/10.2.5/public/admin/template/default/client_log.php @@ -32,6 +32,9 @@
  • {{lang.auto_order}}
  • +
  • + {{lang.info_records}} +
  • diff --git a/10.2.2/public/admin/template/default/client_notice_email.php b/10.2.5/public/admin/template/default/client_notice_email.php similarity index 95% rename from 10.2.2/public/admin/template/default/client_notice_email.php rename to 10.2.5/public/admin/template/default/client_notice_email.php index 29b1f8e4..9ba2d7c7 100644 --- a/10.2.2/public/admin/template/default/client_notice_email.php +++ b/10.2.5/public/admin/template/default/client_notice_email.php @@ -33,6 +33,9 @@
  • {{lang.auto_order}}
  • +
  • + {{lang.info_records}} +
  • @@ -51,7 +54,7 @@ {{lang.email_notice}}
    diff --git a/10.2.2/public/admin/template/default/client_notice_sms.php b/10.2.5/public/admin/template/default/client_notice_sms.php similarity index 95% rename from 10.2.2/public/admin/template/default/client_notice_sms.php rename to 10.2.5/public/admin/template/default/client_notice_sms.php index fae5773f..b789b0c6 100644 --- a/10.2.2/public/admin/template/default/client_notice_sms.php +++ b/10.2.5/public/admin/template/default/client_notice_sms.php @@ -33,6 +33,9 @@
  • {{lang.auto_order}}
  • +
  • + {{lang.info_records}} +
  • @@ -51,7 +54,7 @@ {{lang.email_notice}}
    diff --git a/10.2.2/public/admin/template/default/client_order.php b/10.2.5/public/admin/template/default/client_order.php similarity index 94% rename from 10.2.2/public/admin/template/default/client_order.php rename to 10.2.5/public/admin/template/default/client_order.php index 597ecc81..e29966d4 100644 --- a/10.2.2/public/admin/template/default/client_order.php +++ b/10.2.5/public/admin/template/default/client_order.php @@ -33,7 +33,16 @@
  • {{lang.auto_order}}
  • +
  • + {{lang.info_records}} +
  • +
    + + + + {{lang.create_order}} +
    #{{clientDetail.id}}-{{clientDetail.username ? clientDetail.username : (clientDetail.phone? clientDetail.phone: clientDetail.email)}} @@ -170,10 +179,10 @@ - + - +
    {{lang.sure}} diff --git a/10.2.5/public/admin/template/default/client_records.php b/10.2.5/public/admin/template/default/client_records.php new file mode 100644 index 00000000..ee14bb23 --- /dev/null +++ b/10.2.5/public/admin/template/default/client_records.php @@ -0,0 +1,118 @@ +{include file="header"} + + + +
    +
    + {{lang.user_manage}} + + {{lang.user_list}} + + {{lang.operation}}{{lang.log}} +
    + +
    + + + + #{{clientDetail.id}}-{{clientDetail.username ? clientDetail.username : (clientDetail.phone? clientDetail.phone: clientDetail.email)}} + ({{clientDetail.company}}) + + + #{{item.id}}-{{item.username ? item.username : (item.phone? item.phone: item.email)}} + ({{item.company}}) + + +
    + {{lang.add_records}} + +
    +
    + +
    +

    + {{moment(item.create_time * 1000).format('YYYY-MM-DD HH:mm:ss')}} + {{item.admin_name}} +

    +
    + + +
    +
    +
    + +
    {{item.content}}
    +
    + + + +
    +
    +
    + + + {{lang.order_attachment}} + + {{uploadTip}} + +
    + + {{typeof el === 'string' ? el.split('^')[1] :el.response.save_name.split('^')[1] }} + + +
    +
    +
    + {{lang.sure}} + {{lang.cancel}} +
    +
    +
    +
    +
    +
    +
    +

    {{loadingText}}

    + + + + + +
    + +
    +
    +
    + + + + +{include file="footer"} \ No newline at end of file diff --git a/10.2.2/public/admin/template/default/client_transaction.php b/10.2.5/public/admin/template/default/client_transaction.php similarity index 96% rename from 10.2.2/public/admin/template/default/client_transaction.php rename to 10.2.5/public/admin/template/default/client_transaction.php index 0d8e94ef..565a48c4 100644 --- a/10.2.2/public/admin/template/default/client_transaction.php +++ b/10.2.5/public/admin/template/default/client_transaction.php @@ -33,6 +33,9 @@
  • {{lang.auto_order}}
  • +
  • + {{lang.info_records}} +
  • @@ -82,7 +85,7 @@ - + @@ -91,7 +94,7 @@ - +
    {{lang.submit}} diff --git a/10.2.2/public/admin/template/default/configuration_currency.php b/10.2.5/public/admin/template/default/configuration_currency.php similarity index 95% rename from 10.2.2/public/admin/template/default/configuration_currency.php rename to 10.2.5/public/admin/template/default/configuration_currency.php index 194073ed..0b8073e6 100644 --- a/10.2.2/public/admin/template/default/configuration_currency.php +++ b/10.2.5/public/admin/template/default/configuration_currency.php @@ -10,13 +10,13 @@ - + - + @@ -24,7 +24,7 @@ - + @@ -51,7 +51,7 @@ validator: (val) => val > 0, message: lang.verify4, type: 'warning' } ]"> - + @@ -66,7 +66,7 @@ validator: (val) => val > 0, message: lang.verify4, type: 'warning' } ]"> - + diff --git a/10.2.2/public/admin/template/default/configuration_login.php b/10.2.5/public/admin/template/default/configuration_login.php similarity index 100% rename from 10.2.2/public/admin/template/default/configuration_login.php rename to 10.2.5/public/admin/template/default/configuration_login.php diff --git a/10.2.2/public/admin/template/default/configuration_security.php b/10.2.5/public/admin/template/default/configuration_security.php similarity index 100% rename from 10.2.2/public/admin/template/default/configuration_security.php rename to 10.2.5/public/admin/template/default/configuration_security.php diff --git a/10.2.2/public/admin/template/default/configuration_system.php b/10.2.5/public/admin/template/default/configuration_system.php similarity index 94% rename from 10.2.2/public/admin/template/default/configuration_system.php rename to 10.2.5/public/admin/template/default/configuration_system.php index 51388d4e..6c12990b 100644 --- a/10.2.2/public/admin/template/default/configuration_system.php +++ b/10.2.5/public/admin/template/default/configuration_system.php @@ -33,12 +33,12 @@ - + - + @@ -50,13 +50,13 @@ - + - + @@ -100,7 +100,7 @@ - + diff --git a/10.2.2/public/admin/template/default/configuration_theme.php b/10.2.5/public/admin/template/default/configuration_theme.php similarity index 100% rename from 10.2.2/public/admin/template/default/configuration_theme.php rename to 10.2.5/public/admin/template/default/configuration_theme.php diff --git a/10.2.2/public/admin/template/default/configuration_upgrade.php b/10.2.5/public/admin/template/default/configuration_upgrade.php similarity index 100% rename from 10.2.2/public/admin/template/default/configuration_upgrade.php rename to 10.2.5/public/admin/template/default/configuration_upgrade.php diff --git a/10.2.2/public/admin/template/default/consult.php b/10.2.5/public/admin/template/default/consult.php similarity index 88% rename from 10.2.2/public/admin/template/default/consult.php rename to 10.2.5/public/admin/template/default/consult.php index c426d8eb..ff69e366 100644 --- a/10.2.2/public/admin/template/default/consult.php +++ b/10.2.5/public/admin/template/default/consult.php @@ -19,6 +19,12 @@ + + diff --git a/10.2.2/public/admin/template/default/create_order.php b/10.2.5/public/admin/template/default/create_order.php similarity index 89% rename from 10.2.2/public/admin/template/default/create_order.php rename to 10.2.5/public/admin/template/default/create_order.php index 4e6d50da..dfd0d7ec 100644 --- a/10.2.2/public/admin/template/default/create_order.php +++ b/10.2.5/public/admin/template/default/create_order.php @@ -13,9 +13,7 @@
    - +

    {{item.id}}-{{item.username}}

    @@ -44,10 +42,10 @@ - + - + @@ -185,15 +183,20 @@ class="tree-select" ref="reference" @click.native="checkNum(index)">
    - + -

    - {{lang.optional_config}} -

    -
    +
    +
    +

    {{item.billing_cycle}}

    +

    {{currency_prefix}}{{item.price}}

    +
    +
    + + +
    @@ -201,9 +204,9 @@ class="tree-select" ref="reference" @click.native="checkNum(index)">
    - + - {{lang.submit_order}} + {{lang.submit_order}}
    diff --git a/10.2.2/public/admin/template/default/cron.php b/10.2.5/public/admin/template/default/cron.php similarity index 100% rename from 10.2.2/public/admin/template/default/cron.php rename to 10.2.5/public/admin/template/default/cron.php diff --git a/10.2.2/public/admin/template/default/css/addon.css b/10.2.5/public/admin/template/default/css/addon.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/addon.css rename to 10.2.5/public/admin/template/default/css/addon.css diff --git a/10.2.2/public/admin/template/default/css/addon.less b/10.2.5/public/admin/template/default/css/addon.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/addon.less rename to 10.2.5/public/admin/template/default/css/addon.less diff --git a/10.2.2/public/admin/template/default/css/childAccount.css b/10.2.5/public/admin/template/default/css/childAccount.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/childAccount.css rename to 10.2.5/public/admin/template/default/css/childAccount.css diff --git a/10.2.2/public/admin/template/default/css/childAccount.less b/10.2.5/public/admin/template/default/css/childAccount.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/childAccount.less rename to 10.2.5/public/admin/template/default/css/childAccount.less diff --git a/10.2.2/public/admin/template/default/css/client.css b/10.2.5/public/admin/template/default/css/client.css similarity index 61% rename from 10.2.2/public/admin/template/default/css/client.css rename to 10.2.5/public/admin/template/default/css/client.css index d9804280..0ff38c19 100644 --- a/10.2.2/public/admin/template/default/css/client.css +++ b/10.2.5/public/admin/template/default/css/client.css @@ -25,6 +25,9 @@ cursor: pointer; } /* client-detail */ +.client-detail { + flex-direction: column; +} .client-detail .list-card-container.stop { background-color: rgba(0, 0, 0, 0.01); } @@ -71,8 +74,7 @@ text-align: left; } .client-detail .textarea { - margin-top: 25px !important; - width: 100% !important; + width: 680px !important; } .client-detail .footer-btn { width: 100%; @@ -107,6 +109,63 @@ .client-detail .header-btn .com-transparent:first-child { margin-left: 0; } +.client-detail .info-card { + margin-top: 20px; + display: flex; +} +.client-detail .info-card .t-card:nth-of-type(1) { + flex: 1; + margin-right: 20px; +} +.client-detail .info-card .t-card:nth-of-type(2) { + width: 720px; + flex-shrink: 0; +} +.client-detail .info-box .t-row { + height: 40px; + border-bottom: 1px solid #e7e7e7; +} +.client-detail .info-box .t-row:nth-of-type(1) { + border-top: 1px solid #e7e7e7; +} +.client-detail .info-box .t-row .t-col { + height: 100%; + display: flex; + align-items: center; + font-size: 14px; + color: rgba(0, 0, 0, 0.6); +} +.client-detail .info-box .t-row .t-col > span { + color: rgba(0, 0, 0, 0.9); + margin-right: 40px; +} +.client-detail .info-box .t-row .t-col > div { + display: flex; + align-items: center; +} +.client-detail .info-box .t-row .t-col > div img { + margin-left: 4px; + width: 16px; + height: 16px; +} +.client-detail .info-box .t-row .t-col:nth-of-type(1) { + border-right: 1px solid #e7e7e7; + padding-left: 9px !important; +} +.client-detail .info-box .t-row .t-col:nth-of-type(2) { + padding-left: 30px !important; +} +.client-detail .user-info { + margin-top: 20px; +} +.client-detail .user-info .t-form .t-form__item { + width: 320px; + margin-right: 40px; +} +.client-detail .ip-table td, +.client-detail .ip-table th { + padding-left: 40px; +} /* transaction */ .transaction .t-table__tree-op-icon { display: none; @@ -121,6 +180,31 @@ .transaction .common-look { position: relative; } +.transaction.order .right-search .com-search { + margin-right: 10px; +} +.transaction.order .right-search .search { + margin-right: 20px; +} +.transaction.order .advanced { + align-items: flex-start; +} +.transaction.order .advanced .search { + max-width: none; +} +.transaction.order .advanced .search .search-input { + width: 300px; +} +.transaction.order .advanced .search .t-input__wrap { + margin-right: 10px; +} +.transaction.order .advanced .search .t-select__wrap { + margin-right: 0; +} +.transaction.order .advanced .search .t-date-range-picker { + margin-left: 0; + margin-right: 20px; +} /* client-order */ .client-order .icon-width { padding: 12px 0; @@ -294,10 +378,36 @@ color: var(--td-brand-color); transform: rotateX(180deg); } +.create-order .config-area { + display: flex; + flex-wrap: wrap; +} +.create-order .config-area .config-item { + width: 200px; + height: 100px; + border: 1px solid #ccc; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + flex-shrink: 0; + margin-right: 20px; + margin-bottom: 20px; + cursor: pointer; +} +.create-order .config-area .config-item > p:nth-of-type(1) { + margin-bottom: 15px; +} +.create-order .config-area .config-item.active { + border: 1px solid #0052d9; +} .no-empty + ul + .t-select__empty { display: none; } /* order */ +.order { + /* 2023-04-11 */ +} .order .common-dialog { margin-top: 30px; } @@ -344,6 +454,50 @@ .order .canceled { background: #c4c4c4; } +.order .right-search { + display: flex; +} +.order .right-search .t-select__wrap { + width: auto; + margin-right: 10px; +} +.order .right-search .search-input { + width: 280px; +} +.order .right-search .com-search { + margin-right: 20px; +} +.order .advanced { + display: flex; + justify-content: flex-end; + align-items: flex-start; + border-top: 1px solid #ccc; + padding: 15px 0; +} +.order .advanced .search { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + margin-right: 10px; +} +.order .advanced .search .t-input__wrap { + width: auto; +} +.order .advanced .search .search-input { + width: 260px; + margin-right: 10px; + margin-bottom: 10px; +} +.order .advanced .search .t-date-range-picker { + width: 260px; + margin-left: 10px; + margin-right: 10px; + margin-bottom: 10px; +} +.order .advanced .t-select__wrap { + width: 180px; + margin-right: 10px; +} /* host-detail */ .host-detail .t-row { width: auto; @@ -501,6 +655,14 @@ color: #03B193; } /* order-details */ +.order-details .t-table { + overflow: visible; +} +.order-details .t-table .t-popup__content { + white-space: pre-wrap; + max-height: 300px; + overflow-y: auto; +} .order-details .initiate_refund { margin-bottom: 10px; } @@ -585,3 +747,179 @@ .order-details thead tr { background: #F3F5F8; } +/* 个人资料-信息记录 */ +.client_records .loading { + text-align: center; + color: #999; + max-width: 1130px; +} +.client_records .record-list { + max-width: 1130px; + position: relative; + margin-top: 40px; +} +.client_records .record-list::before { + content: ''; + left: 0; + position: absolute; + top: 0; + height: 100%; + border-left: 1px dashed #DCDCDC; +} +.client_records .record-list .top { + margin: 0; + font-size: 14px; + color: rgba(0, 0, 0, 0.6); + margin-bottom: 10px; + line-height: 20px; + display: flex; + justify-content: space-between; +} +.client_records .record-list .top p { + margin: 0; +} +.client_records .record-list .top .user { + margin-left: 30px; +} +.client_records .record-list .top .opt .t-icon { + margin-left: 30px; + cursor: pointer; +} +.client_records .record-list .r-item { + padding-left: 20px; + position: relative; + margin-bottom: 30px; +} +.client_records .record-list .r-item .time-icon { + background: #ffff; + position: relative; + padding: 2px; + z-index: 2; + position: absolute; + top: 0; + left: -9px; + color: #00A870; +} +.client_records .record-list .r-item:hover .des { + background: #ECF2FE; + border-color: var(--td-brand-color-active); +} +.client_records .record-list .r-item:hover .top .edit { + color: var(--td-brand-color-active); +} +.client_records .record-list .r-item:hover .top .del { + color: #E34D59; +} +.client_records .record-list .r-item .t-input__extra { + display: none; +} +.client_records .record-list .des { + color: rgba(0, 0, 0, 0.9); + background: #F3F5F8; + padding: 20px; + font-size: 14px; + line-height: 20px; + text-align: justify; + border-left: 3px solid #DBDBDB; + border-radius: 3px; + overflow: hidden; + transition: all 0.3s; +} +.client_records .record-list .file { + margin-top: 10px; + display: flex; + align-items: center; + justify-content: space-between; +} +.client_records .record-list .file .left { + display: flex; + align-items: center; + flex-wrap: wrap; +} +.client_records .record-list .file .f-item { + display: flex; + align-items: center; + color: rgba(0, 0, 0, 0.9); + margin-right: 20px; + cursor: pointer; +} +.client_records .record-list .file .f-item .t-icon { + margin-right: 7px; + color: rgba(0, 0, 0, 0.4); +} +.client_records .record-list .file .f-item .delfile { + background: #E34D59; + margin-left: 4px; + margin-right: 0; + border-radius: 50%; + color: #fff; +} +.client_records .record-list .file .submit-btn { + margin-right: 20px; +} +.client_records .record-list .t-form__label { + display: none; +} +.client_records .record-list .t-form__controls { + margin-left: 0 !important; +} +.client_records .record-list .submit { + white-space: nowrap; + margin-left: 20px; +} +.client_records .record-list .upload { + background: #fff; + color: rgba(0, 0, 0, 0.9); + margin-right: 20px; +} +.client_records .record-list .upload .t-button__text { + display: flex; + align-items: center; +} +.client_records .record-list .upload .t-button__text .t-icon { + color: rgba(0, 0, 0, 0.9); + margin-right: 8px; +} +#viewer, +.viewer-navbar { + display: none; +} +/* host */ +.host .right-search { + display: flex; + flex-wrap: wrap; +} +.host .right-search .t-input__wrap, +.host .right-search .t-select__wrap { + width: auto; +} +.host .right-search .t-input__wrap { + width: 200px; + margin-right: 10px; + margin-bottom: 10px; +} +.host .right-search .search-input { + width: 360px; +} +.host .right-search .t-date-range-picker { + width: 280px; + margin-right: 20px; +} +.host .right-search .t-date-range-picker .t-input__wrap { + margin-bottom: 0; +} +#myPopup .t-popup { + width: 100%; +} +#myPopup .t-popup__content { + max-height: 400px; + overflow-y: auto; +} +@media screen and (max-width: 1500px) { + .host .right-search .t-input__wrap { + width: 120px; + } + .host .right-search .search-input { + width: 240px; + } +} diff --git a/10.2.2/public/admin/template/default/css/client.less b/10.2.5/public/admin/template/default/css/client.less similarity index 59% rename from 10.2.2/public/admin/template/default/css/client.less rename to 10.2.5/public/admin/template/default/css/client.less index 63819eab..c0094673 100644 --- a/10.2.2/public/admin/template/default/css/client.less +++ b/10.2.5/public/admin/template/default/css/client.less @@ -43,6 +43,8 @@ /* client-detail */ .client-detail { + flex-direction: column; + .list-card-container.stop { background-color: rgba(0, 0, 0, 0.01); @@ -113,8 +115,7 @@ } .textarea { - margin-top: 25px !important; - width: 100% !important; + width: 680px !important; } .footer-btn { @@ -158,6 +159,90 @@ } .login-log {} + + .info-card { + margin-top: 20px; + display: flex; + + .t-card { + &:nth-of-type(1) { + flex: 1; + margin-right: 20px; + } + + &:nth-of-type(2) { + width: 720px; + flex-shrink: 0; + } + } + } + + .info-box { + .t-row { + height: 40px; + border-bottom: 1px solid rgba(231, 231, 231, 1); + + &:nth-of-type(1) { + border-top: 1px solid rgba(231, 231, 231, 1); + } + + .t-col { + height: 100%; + display: flex; + align-items: center; + font-size: 14px; + color: rgba(0, 0, 0, 0.6); + + >span { + color: rgba(0, 0, 0, 0.9); + margin-right: 40px; + } + + >div { + display: flex; + align-items: center; + + img { + margin-left: 4px; + width: 16px; + height: 16px; + } + } + + + + &:nth-of-type(1) { + border-right: 1px solid rgba(231, 231, 231, 1); + padding-left: 9px !important; + + } + + &:nth-of-type(2) { + padding-left: 30px !important; + } + + } + } + } + + .user-info { + margin-top: 20px; + + .t-form { + .t-form__item { + width: 320px; + margin-right: 40px; + } + } + } + + .ip-table { + + td, + th { + padding-left: 40px; + } + } } /* transaction */ @@ -179,6 +264,44 @@ .common-look { position: relative; } + + &.order { + .right-search { + .com-search { + margin-right: 10px; + } + + .search { + margin-right: 20px; + } + } + + .advanced { + align-items: flex-start; + + .search { + max-width: none; + + .search-input { + width: 300px; + } + + .t-input__wrap { + margin-right: 10px; + } + + .t-select__wrap { + margin-right: 0; + } + + .t-date-range-picker { + margin-left: 0; + margin-right: 20px; + } + } + } + } + } /* client-order */ @@ -272,18 +395,23 @@ margin-right: 3px; } } -.order-canceled{ + +.order-canceled { background: #888888 !important; } -.order-paid{ + +.order-paid { background: #067945 !important; } -.order-refunded{ + +.order-refunded { background: #B52619 !important; } -.order-unpaid{ + +.order-unpaid { background: #2F4484 !important; } + /* create-order */ .create-order { .t-col { @@ -416,6 +544,33 @@ transform: rotateX(180deg); } } + + .config-area { + display: flex; + flex-wrap: wrap; + + .config-item { + width: 200px; + height: 100px; + border: 1px solid #ccc; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + flex-shrink: 0; + margin-right: 20px; + margin-bottom: 20px; + cursor: pointer; + + >p:nth-of-type(1) { + margin-bottom: 15px; + } + + &.active { + border: 1px solid #0052d9; + } + } + } } .no-empty+ul+.t-select__empty { @@ -482,11 +637,56 @@ white-space: nowrap; } - - .canceled { background: #c4c4c4; } + + /* 2023-04-11 */ + .right-search{ + display: flex; + .t-select__wrap{ + width: auto; + margin-right: 10px; + } + .search-input{ + width: 280px; + } + .com-search{ + margin-right: 20px; + } + } + .advanced{ + display: flex; + justify-content: flex-end; + align-items: flex-start; + border-top: 1px solid #ccc; + padding: 15px 0; + .search{ + display: flex; + // max-width: 770px; + flex-wrap: wrap; + justify-content: flex-end; + margin-right: 10px; + .t-input__wrap{ + width: auto; + } + .search-input{ + width: 260px; + margin-right: 10px; + margin-bottom: 10px; + } + .t-date-range-picker{ + width: 260px; + margin-left: 10px; + margin-right: 10px; + margin-bottom: 10px; + } + } + .t-select__wrap{ + width: 180px; + margin-right: 10px; + } + } } /* host-detail */ @@ -702,11 +902,23 @@ } /* order-details */ -.order-details{ - .initiate_refund{ + +.order-details { + .t-table { + overflow: visible; + + .t-popup__content { + white-space: pre-wrap; + max-height: 300px; + overflow-y: auto; + } + } + + .initiate_refund { margin-bottom: 10px; } - .top-info{ + + .top-info { background: #F3F5F8; padding: 10px; padding-bottom: 15px; @@ -714,27 +926,32 @@ align-items: center; margin-bottom: 60px; } - .left-box{ + + .left-box { background: #fff; width: 900px; display: flex; flex-wrap: wrap; padding: 30px 0; - .aHover{ + + .aHover { color: var(--td-brand-color-8); } - .item{ + + .item { width: 50%; line-height: 30px; font-size: 14px; color: #333; - .txt{ + + .txt { width: 90px; display: inline-block; text-align: right; margin-right: 90px; } - .btn{ + + .btn { display: inline-block; padding: 4px 8px; border: 1px solid var(--td-brand-color-8); @@ -747,45 +964,281 @@ } } } - .r-box{ + + .r-box { flex: 1; display: flex; justify-content: center; - .con{ + + .con { text-align: center; max-width: 240px; } } - .order-pay{ + + .order-pay { width: 240px; margin: 10px 0; } - .signPay{ + + .signPay { border: 1px solid #DCDCDC; line-height: 32px; padding: 0 14px; display: inline-block; border-radius: 3px; - color: rgba(0,0,0,.6); + color: rgba(0, 0, 0, .6); cursor: pointer; margin: 0; font-size: 12px; - &:hover{ + + &:hover { background: #F3F3F3; } } - .time,.gateway{ + + .time, + .gateway { margin: 0; line-height: 1; margin-top: 10px; } - .checkDelete{ + + .checkDelete { margin: 10px 0 0 100px; color: var(--td-text-color-placeholder); } + thead { - tr{ + tr { + background: #F3F5F8; + } + } +} + + +/* 个人资料-信息记录 */ +.client_records { + .loading { + text-align: center; + color: #999; + max-width: 1130px; + } + + .record-list { + max-width: 1130px; + position: relative; + margin-top: 40px; + + &::before { + content: ''; + left: 0; + position: absolute; + top: 0; + height: 100%; + border-left: 1px dashed #DCDCDC; + } + + .top { + margin: 0; + font-size: 14px; + color: rgba(0, 0, 0, 0.60); + margin-bottom: 10px; + line-height: 20px; + display: flex; + justify-content: space-between; + + p { + margin: 0; + } + + .user { + margin-left: 30px; + } + + .opt { + .t-icon { + margin-left: 30px; + cursor: pointer; + } + } + } + + .r-item { + padding-left: 20px; + position: relative; + margin-bottom: 30px; + + .time-icon { + background: #ffff; + position: relative; + padding: 2px; + z-index: 2; + position: absolute; + top: 0; + left: -9px; + color: #00A870; + } + + &:hover { + .des { + background: #ECF2FE; + border-color: var(--td-brand-color-active); + } + + .top { + .edit { + color: var(--td-brand-color-active); + } + + .del { + color: #E34D59; + } + } + } + + .t-input__extra { + display: none; + } + } + + .des { + color: rgba(0, 0, 0, 0.90); background: #F3F5F8; + padding: 20px; + font-size: 14px; + line-height: 20px; + text-align: justify; + border-left: 3px solid #DBDBDB; + border-radius: 3px; + overflow: hidden; + transition: all .3s; + } + + .file { + margin-top: 10px; + display: flex; + align-items: center; + justify-content: space-between; + + .left { + display: flex; + align-items: center; + flex-wrap: wrap; + } + + .f-item { + display: flex; + align-items: center; + color: rgba(0, 0, 0, 0.90); + margin-right: 20px; + cursor: pointer; + + .t-icon { + margin-right: 7px; + color: rgba(0, 0, 0, 0.40); + } + + .delfile { + background: #E34D59; + margin-left: 4px; + margin-right: 0; + border-radius: 50%; + color: #fff; + } + } + + .submit-btn { + margin-right: 20px; + } + } + + .t-form__label { + display: none; + } + + .t-form__controls { + margin-left: 0 !important; + } + + .submit { + white-space: nowrap; + margin-left: 20px; + } + + .upload { + background: #fff; + color: rgba(0, 0, 0, 0.90); + margin-right: 20px; + + .t-button__text { + display: flex; + align-items: center; + + .t-icon { + color: rgba(0, 0, 0, 0.90); + margin-right: 8px; + } + } + } + } +} + +#viewer, +.viewer-navbar { + display: none; +} + +/* host */ +.host { + .right-search { + display: flex; + flex-wrap: wrap; + + .t-input__wrap, + .t-select__wrap { + width: auto; + } + + .t-input__wrap { + width: 200px; + margin-right: 10px; + margin-bottom: 10px; + } + + .search-input { + width: 360px; + } + + .t-date-range-picker { + width: 280px; + margin-right: 20px; + + .t-input__wrap { + margin-bottom: 0; + } + } + } +} +#myPopup{ + .t-popup{ + width: 100%; + } + .t-popup__content{ + max-height: 400px; + overflow-y: auto; + } +} +@media screen and (max-width: 1500px) { + .host { + .right-search { + .t-input__wrap { + width: 120px; + } + + .search-input { + width: 240px; + } } } } \ No newline at end of file diff --git a/10.2.2/public/admin/template/default/css/common/reset.css b/10.2.5/public/admin/template/default/css/common/reset.css similarity index 97% rename from 10.2.2/public/admin/template/default/css/common/reset.css rename to 10.2.5/public/admin/template/default/css/common/reset.css index e776b68c..cb65f22e 100644 --- a/10.2.2/public/admin/template/default/css/common/reset.css +++ b/10.2.5/public/admin/template/default/css/common/reset.css @@ -267,9 +267,10 @@ a { } .aHover { cursor: pointer; + border-bottom: 1px solid transparent; } .aHover:hover { - border-bottom: 1px solid var(--td-text-color-primary); + border-bottom-color: var(--td-text-color-primary); } .t-table td, .t-table th { @@ -1089,7 +1090,7 @@ textarea { width: 350px; position: absolute; top: 47px; - left: 47px; + left: 5px; background-color: #fff; box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.08); border-radius: 3px; @@ -1106,7 +1107,7 @@ textarea { margin-bottom: 20px; } .global-search .search-content .item { - margin-bottom: 37px; + margin-bottom: 10px; } .global-search .search-content .item:last-child { margin-bottom: 0; @@ -1218,3 +1219,23 @@ textarea { max-height: 400px !important; overflow-y: auto !important; } +/* 重置折叠样式 */ +.search-content .t-collapse { + background: transparent; + border: none; +} +.search-content .t-collapse-panel__wrapper .t-collapse-panel__header { + padding: 0; + height: auto; + color: #0052D9; + border-bottom: none; + font-weight: normal; +} +.search-content .t-collapse-panel__wrapper .t-collapse-panel__body { + border: none; + background: #fff; + margin-top: 20px; +} +.search-content .t-collapse-panel__content { + padding: 0; +} diff --git a/10.2.2/public/admin/template/default/css/common/reset.less b/10.2.5/public/admin/template/default/css/common/reset.less similarity index 97% rename from 10.2.2/public/admin/template/default/css/common/reset.less rename to 10.2.5/public/admin/template/default/css/common/reset.less index e77f804a..6711e40f 100644 --- a/10.2.2/public/admin/template/default/css/common/reset.less +++ b/10.2.5/public/admin/template/default/css/common/reset.less @@ -82,11 +82,12 @@ a { .aHover { cursor: pointer; + border-bottom: 1px solid transparent; } .aHover:hover { // text-decoration: underline; - border-bottom: 1px solid var(--td-text-color-primary); + border-bottom-color: var(--td-text-color-primary); } .t-table td, @@ -1119,7 +1120,7 @@ textarea { width: 350px; position: absolute; top: 47px; - left: 47px; + left: 5px; background-color: #fff; box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.0800); border-radius: 3px; @@ -1138,7 +1139,7 @@ textarea { } .item { - margin-bottom: 37px; + margin-bottom: 10px; &:last-child { margin-bottom: 0; @@ -1284,4 +1285,26 @@ textarea { .t-menu__popup.t-is-vertical{ max-height: 400px !important; overflow-y: auto !important; -} \ No newline at end of file +} +/* 重置折叠样式 */ +.search-content{ + .t-collapse{ + background: transparent; + border: none; + } + .t-collapse-panel__wrapper .t-collapse-panel__header{ + padding: 0; + height: auto; + color: #0052D9; + border-bottom: none; + font-weight: normal; + } + .t-collapse-panel__wrapper .t-collapse-panel__body{ + border: none; + background: #fff; + margin-top: 20px; + } + .t-collapse-panel__content{ + padding: 0; + } +} diff --git a/10.2.2/public/admin/template/default/css/common/tdesign.min.css b/10.2.5/public/admin/template/default/css/common/tdesign.min.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/common/tdesign.min.css rename to 10.2.5/public/admin/template/default/css/common/tdesign.min.css diff --git a/10.2.2/public/admin/template/default/css/common/viewer.min.css b/10.2.5/public/admin/template/default/css/common/viewer.min.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/common/viewer.min.css rename to 10.2.5/public/admin/template/default/css/common/viewer.min.css diff --git a/10.2.2/public/admin/template/default/css/customerService.css b/10.2.5/public/admin/template/default/css/customerService.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/customerService.css rename to 10.2.5/public/admin/template/default/css/customerService.css diff --git a/10.2.2/public/admin/template/default/css/index.css b/10.2.5/public/admin/template/default/css/index.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/index.css rename to 10.2.5/public/admin/template/default/css/index.css diff --git a/10.2.2/public/admin/template/default/css/install.css b/10.2.5/public/admin/template/default/css/install.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/install.css rename to 10.2.5/public/admin/template/default/css/install.css diff --git a/10.2.2/public/admin/template/default/css/invoice_address.css b/10.2.5/public/admin/template/default/css/invoice_address.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/invoice_address.css rename to 10.2.5/public/admin/template/default/css/invoice_address.css diff --git a/10.2.2/public/admin/template/default/css/invoice_address.less b/10.2.5/public/admin/template/default/css/invoice_address.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/invoice_address.less rename to 10.2.5/public/admin/template/default/css/invoice_address.less diff --git a/10.2.2/public/admin/template/default/css/invoice_config.css b/10.2.5/public/admin/template/default/css/invoice_config.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/invoice_config.css rename to 10.2.5/public/admin/template/default/css/invoice_config.css diff --git a/10.2.2/public/admin/template/default/css/invoice_config.less b/10.2.5/public/admin/template/default/css/invoice_config.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/invoice_config.less rename to 10.2.5/public/admin/template/default/css/invoice_config.less diff --git a/10.2.2/public/admin/template/default/css/invoice_system.css b/10.2.5/public/admin/template/default/css/invoice_system.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/invoice_system.css rename to 10.2.5/public/admin/template/default/css/invoice_system.css diff --git a/10.2.2/public/admin/template/default/css/invoice_system.less b/10.2.5/public/admin/template/default/css/invoice_system.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/invoice_system.less rename to 10.2.5/public/admin/template/default/css/invoice_system.less diff --git a/10.2.2/public/admin/template/default/css/invoice_title.css b/10.2.5/public/admin/template/default/css/invoice_title.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/invoice_title.css rename to 10.2.5/public/admin/template/default/css/invoice_title.css diff --git a/10.2.2/public/admin/template/default/css/invoice_title.less b/10.2.5/public/admin/template/default/css/invoice_title.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/invoice_title.less rename to 10.2.5/public/admin/template/default/css/invoice_title.less diff --git a/10.2.2/public/admin/template/default/css/login.css b/10.2.5/public/admin/template/default/css/login.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/login.css rename to 10.2.5/public/admin/template/default/css/login.css diff --git a/10.2.2/public/admin/template/default/css/login.less b/10.2.5/public/admin/template/default/css/login.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/login.less rename to 10.2.5/public/admin/template/default/css/login.less diff --git a/10.2.2/public/admin/template/default/css/manage.css b/10.2.5/public/admin/template/default/css/manage.css similarity index 87% rename from 10.2.2/public/admin/template/default/css/manage.css rename to 10.2.5/public/admin/template/default/css/manage.css index f911afe5..dc7de3f9 100644 --- a/10.2.2/public/admin/template/default/css/manage.css +++ b/10.2.5/public/admin/template/default/css/manage.css @@ -24,22 +24,26 @@ width: 360px; } /* task */ +.task .t-form { + flex-wrap: nowrap; +} .task .t-form .t-form__label { width: auto !important; padding-right: 10px !important; } .task .t-form .t-form__controls { - width: 280px; margin-left: 0 !important; + margin-right: 0; } .task .t-form .t-form__item { - margin-right: 40px !important; + margin-right: 0 !important; + min-width: auto; } .task .t-form .search .t-form__controls { - width: 360px; + width: 200px; } .task .t-form .f-btn { - margin-left: 40px; + margin-left: 20px; } .task .t-form .f-btn .t-button { margin-right: 20px; @@ -48,6 +52,10 @@ width: 14px; height: 14px; } +.task .t-date-range-picker { + width: 300px; + margin: 0 10px; +} @media screen and (max-width: 1400px) { .task .t-form .search .t-form__controls { width: 200px; diff --git a/10.2.2/public/admin/template/default/css/manage.less b/10.2.5/public/admin/template/default/css/manage.less similarity index 74% rename from 10.2.2/public/admin/template/default/css/manage.less rename to 10.2.5/public/admin/template/default/css/manage.less index 3cd8ee3b..d820f5a3 100644 --- a/10.2.2/public/admin/template/default/css/manage.less +++ b/10.2.5/public/admin/template/default/css/manage.less @@ -8,8 +8,9 @@ width: 360px; } } + .log-description-width { - img{ + img { width: 140px; height: 84px; } @@ -35,70 +36,88 @@ /* task */ .task { .t-form { + flex-wrap: nowrap; + .t-form__label { width: auto !important; padding-right: 10px !important; } .t-form__controls { - width: 280px; margin-left: 0 !important; + margin-right: 0; } .t-form__item { - margin-right: 40px !important; + margin-right: 0 !important; + min-width: auto; } + .search { .t-form__controls { - width: 360px; + width: 200px; } } .f-btn { - margin-left: 40px; + margin-left: 20px; + .t-button { margin-right: 20px; } } } - .task-icon{ + + .task-icon { width: 14px; height: 14px; } + + .t-date-range-picker { + width: 300px; + margin: 0 10px; + } } + @media screen and (max-width: 1400px) { .task { .t-form { - .search{ - .t-form__controls{ + .search { + .t-form__controls { width: 200px; } } - .t-form__controls{ + + .t-form__controls { width: 200px; } - .t-form__item{ + + .t-form__item { margin-right: 20px !important; } + .f-btn { margin-left: 0; margin-right: 0 !important; - .t-form__controls{ + + .t-form__controls { width: auto; } } } } } + @media screen and (max-width: 1100px) { .task { .t-form { - .search{ - .t-form__controls{ + .search { + .t-form__controls { width: 150px; } } - .t-form__controls{ + + .t-form__controls { width: 150px; } } diff --git a/10.2.2/public/admin/template/default/css/navigation.css b/10.2.5/public/admin/template/default/css/navigation.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/navigation.css rename to 10.2.5/public/admin/template/default/css/navigation.css diff --git a/10.2.2/public/admin/template/default/css/product.css b/10.2.5/public/admin/template/default/css/product.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/product.css rename to 10.2.5/public/admin/template/default/css/product.css diff --git a/10.2.2/public/admin/template/default/css/product.less b/10.2.5/public/admin/template/default/css/product.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/product.less rename to 10.2.5/public/admin/template/default/css/product.less diff --git a/10.2.2/public/admin/template/default/css/rc_order.css b/10.2.5/public/admin/template/default/css/rc_order.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/rc_order.css rename to 10.2.5/public/admin/template/default/css/rc_order.css diff --git a/10.2.2/public/admin/template/default/css/rc_order.less b/10.2.5/public/admin/template/default/css/rc_order.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/rc_order.less rename to 10.2.5/public/admin/template/default/css/rc_order.less diff --git a/10.2.2/public/admin/template/default/css/rc_order_config.css b/10.2.5/public/admin/template/default/css/rc_order_config.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/rc_order_config.css rename to 10.2.5/public/admin/template/default/css/rc_order_config.css diff --git a/10.2.2/public/admin/template/default/css/rc_order_config.less b/10.2.5/public/admin/template/default/css/rc_order_config.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/rc_order_config.less rename to 10.2.5/public/admin/template/default/css/rc_order_config.less diff --git a/10.2.2/public/admin/template/default/css/rc_order_details.css b/10.2.5/public/admin/template/default/css/rc_order_details.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/rc_order_details.css rename to 10.2.5/public/admin/template/default/css/rc_order_details.css diff --git a/10.2.2/public/admin/template/default/css/rc_order_details.less b/10.2.5/public/admin/template/default/css/rc_order_details.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/rc_order_details.less rename to 10.2.5/public/admin/template/default/css/rc_order_details.less diff --git a/10.2.2/public/admin/template/default/css/real_name.css b/10.2.5/public/admin/template/default/css/real_name.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/real_name.css rename to 10.2.5/public/admin/template/default/css/real_name.css diff --git a/10.2.2/public/admin/template/default/css/recording1559.css b/10.2.5/public/admin/template/default/css/recording1559.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/recording1559.css rename to 10.2.5/public/admin/template/default/css/recording1559.css diff --git a/10.2.2/public/admin/template/default/css/search1559.css b/10.2.5/public/admin/template/default/css/search1559.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/search1559.css rename to 10.2.5/public/admin/template/default/css/search1559.css diff --git a/10.2.2/public/admin/template/default/css/setting.css b/10.2.5/public/admin/template/default/css/setting.css similarity index 97% rename from 10.2.2/public/admin/template/default/css/setting.css rename to 10.2.5/public/admin/template/default/css/setting.css index 534cf375..e3c6cddd 100644 --- a/10.2.2/public/admin/template/default/css/setting.css +++ b/10.2.5/public/admin/template/default/css/setting.css @@ -188,6 +188,9 @@ width: 100%; } /* admin */ +.admin { + /* 2023-04-11 */ +} .admin .status { padding: 0 17px !important; } @@ -198,6 +201,18 @@ margin-left: 20px; margin-right: 0; } +.admin .right-search { + display: flex; +} +.admin .right-search .com-search { + margin-right: 20px; +} +.admin .right-search .search-input { + width: 240px; +} +.admin .right-search .t-select__wrap { + margin-right: 10px; +} /* admin-role */ .admin-role .auth-dialog .t-form__controls-content { display: flex; diff --git a/10.2.2/public/admin/template/default/css/setting.less b/10.2.5/public/admin/template/default/css/setting.less similarity index 97% rename from 10.2.2/public/admin/template/default/css/setting.less rename to 10.2.5/public/admin/template/default/css/setting.less index a3af9658..1187f8da 100644 --- a/10.2.2/public/admin/template/default/css/setting.less +++ b/10.2.5/public/admin/template/default/css/setting.less @@ -265,6 +265,19 @@ margin-right: 0; } } + /* 2023-04-11 */ + .right-search{ + display: flex; + .com-search{ + margin-right: 20px; + } + .search-input{ + width: 240px; + } + .t-select__wrap{ + margin-right: 10px; + } + } } /* admin-role */ diff --git a/10.2.2/public/admin/template/default/css/setting1559.css b/10.2.5/public/admin/template/default/css/setting1559.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/setting1559.css rename to 10.2.5/public/admin/template/default/css/setting1559.css diff --git a/10.2.2/public/admin/template/default/css/supplier_list.css b/10.2.5/public/admin/template/default/css/supplier_list.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/supplier_list.css rename to 10.2.5/public/admin/template/default/css/supplier_list.css diff --git a/10.2.2/public/admin/template/default/css/supplier_list.less b/10.2.5/public/admin/template/default/css/supplier_list.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/supplier_list.less rename to 10.2.5/public/admin/template/default/css/supplier_list.less diff --git a/10.2.2/public/admin/template/default/css/system.css b/10.2.5/public/admin/template/default/css/system.css similarity index 95% rename from 10.2.2/public/admin/template/default/css/system.css rename to 10.2.5/public/admin/template/default/css/system.css index 97d9983a..3060ef2f 100644 --- a/10.2.2/public/admin/template/default/css/system.css +++ b/10.2.5/public/admin/template/default/css/system.css @@ -115,6 +115,11 @@ max-width: 100%; max-height: 100%; } +.feedback .web-logo .t-upload__card-content, +.feedback .web-logo .t-upload__card-container { + width: 260px; + height: 68px; +} #viewer { width: 0; height: 0; diff --git a/10.2.2/public/admin/template/default/css/system.less b/10.2.5/public/admin/template/default/css/system.less similarity index 95% rename from 10.2.2/public/admin/template/default/css/system.less rename to 10.2.5/public/admin/template/default/css/system.less index a884e7aa..e3ffa8ff 100644 --- a/10.2.2/public/admin/template/default/css/system.less +++ b/10.2.5/public/admin/template/default/css/system.less @@ -124,6 +124,12 @@ } } } + .web-logo{ + .t-upload__card-content,.t-upload__card-container{ + width: 260px; + height: 68px; + } + } } #viewer { width: 0; diff --git a/10.2.2/public/admin/template/default/css/template.css b/10.2.5/public/admin/template/default/css/template.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/template.css rename to 10.2.5/public/admin/template/default/css/template.css diff --git a/10.2.2/public/admin/template/default/css/template.less b/10.2.5/public/admin/template/default/css/template.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/template.less rename to 10.2.5/public/admin/template/default/css/template.less diff --git a/10.2.2/public/admin/template/default/css/theme/cyan.less b/10.2.5/public/admin/template/default/css/theme/cyan.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/cyan.less rename to 10.2.5/public/admin/template/default/css/theme/cyan.less diff --git a/10.2.2/public/admin/template/default/css/theme/default.less b/10.2.5/public/admin/template/default/css/theme/default.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/default.less rename to 10.2.5/public/admin/template/default/css/theme/default.less diff --git a/10.2.2/public/admin/template/default/css/theme/green.less b/10.2.5/public/admin/template/default/css/theme/green.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/green.less rename to 10.2.5/public/admin/template/default/css/theme/green.less diff --git a/10.2.2/public/admin/template/default/css/theme/index.less b/10.2.5/public/admin/template/default/css/theme/index.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/index.less rename to 10.2.5/public/admin/template/default/css/theme/index.less diff --git a/10.2.2/public/admin/template/default/css/theme/orange.less b/10.2.5/public/admin/template/default/css/theme/orange.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/orange.less rename to 10.2.5/public/admin/template/default/css/theme/orange.less diff --git a/10.2.2/public/admin/template/default/css/theme/pink.less b/10.2.5/public/admin/template/default/css/theme/pink.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/pink.less rename to 10.2.5/public/admin/template/default/css/theme/pink.less diff --git a/10.2.2/public/admin/template/default/css/theme/purple.less b/10.2.5/public/admin/template/default/css/theme/purple.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/purple.less rename to 10.2.5/public/admin/template/default/css/theme/purple.less diff --git a/10.2.2/public/admin/template/default/css/theme/red.less b/10.2.5/public/admin/template/default/css/theme/red.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/red.less rename to 10.2.5/public/admin/template/default/css/theme/red.less diff --git a/10.2.2/public/admin/template/default/css/theme/variables.less b/10.2.5/public/admin/template/default/css/theme/variables.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/variables.less rename to 10.2.5/public/admin/template/default/css/theme/variables.less diff --git a/10.2.2/public/admin/template/default/css/theme/yellow.less b/10.2.5/public/admin/template/default/css/theme/yellow.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/theme/yellow.less rename to 10.2.5/public/admin/template/default/css/theme/yellow.less diff --git a/10.2.2/public/admin/template/default/css/upstream_order.css b/10.2.5/public/admin/template/default/css/upstream_order.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/upstream_order.css rename to 10.2.5/public/admin/template/default/css/upstream_order.css diff --git a/10.2.2/public/admin/template/default/css/upstream_order.less b/10.2.5/public/admin/template/default/css/upstream_order.less similarity index 100% rename from 10.2.2/public/admin/template/default/css/upstream_order.less rename to 10.2.5/public/admin/template/default/css/upstream_order.less diff --git a/10.2.2/public/admin/template/default/css/withdrawal.css b/10.2.5/public/admin/template/default/css/withdrawal.css similarity index 100% rename from 10.2.2/public/admin/template/default/css/withdrawal.css rename to 10.2.5/public/admin/template/default/css/withdrawal.css diff --git a/10.2.2/public/admin/template/default/customerService.php b/10.2.5/public/admin/template/default/customerService.php similarity index 100% rename from 10.2.2/public/admin/template/default/customerService.php rename to 10.2.5/public/admin/template/default/customerService.php diff --git a/10.2.2/public/admin/template/default/footer.php b/10.2.5/public/admin/template/default/footer.php similarity index 100% rename from 10.2.2/public/admin/template/default/footer.php rename to 10.2.5/public/admin/template/default/footer.php diff --git a/10.2.2/public/admin/template/default/gateway.php b/10.2.5/public/admin/template/default/gateway.php similarity index 94% rename from 10.2.2/public/admin/template/default/gateway.php rename to 10.2.5/public/admin/template/default/gateway.php index 2294b299..dfb0b45b 100644 --- a/10.2.2/public/admin/template/default/gateway.php +++ b/10.2.5/public/admin/template/default/gateway.php @@ -7,7 +7,7 @@ {{lang.get_more}} - + - + - + @@ -77,7 +77,7 @@ - + diff --git a/10.2.2/public/admin/template/default/header.php b/10.2.5/public/admin/template/default/header.php similarity index 79% rename from 10.2.2/public/admin/template/default/header.php rename to 10.2.5/public/admin/template/default/header.php index bcc31dd1..7ef1b5dc 100644 --- a/10.2.2/public/admin/template/default/header.php +++ b/10.2.5/public/admin/template/default/header.php @@ -39,47 +39,52 @@ -->