diff --git a/addon/cossms/admin/controller/Message.php b/addon/cossms/admin/controller/Message.php new file mode 100644 index 00000000..b050f902 --- /dev/null +++ b/addon/cossms/admin/controller/Message.php @@ -0,0 +1,69 @@ +getMessageInfo($this->site_id,$keywords); + $info = $info_result["data"]; + if (request()->isAjax()) { + if (empty($info)) + return error("", "不存在的模板信息!"); + $sms_json_array = $info["sms_json_array"];//短信配置 + $template_id = input("template_id", '');//短信模板id + $smssign = input("smssign", '');//短信签名 + $content = input("content", '');//短信签名 + $sms_is_open = input("sms_is_open", 0); + $sms_json_array['template_id'] = $template_id;//模板ID (备注:服务商提供的模板ID) + $sms_json_array['content'] = $content;//模板内容 (备注:仅用于显示) + $sms_json_array['smssign'] = $smssign;//短信签名 (备注:请填写短信签名(如果服务商是大于请填写审核成功的签名)) + $data = array( + 'sms_json' => json_encode($sms_json_array), + "sms_is_open" => $sms_is_open, + ); + $condition = array( + [ "site_id", "=", $this->site_id ], + [ "keywords", "=", $keywords ] + ); + $res = $message_model->editMessage($data, $condition); + return $res; + } else { + if (empty($info)) + $this->error("不存在的模板信息!"); + $sms_json_array = $info["sms_json_array"];//短信配置 + $this->assign("info", $sms_json_array); + $this->assign("sms_is_open", $info["sms_is_open"]); + $this->assign("keywords", $keywords); + //模板变量 + $message_variable_list = $info["message_json_array"]; + $this->assign("message_variable_list", $message_variable_list); + return $this->fetch('message/edit'); + } + } + +} \ No newline at end of file diff --git a/addon/cossms/admin/controller/Sms.php b/addon/cossms/admin/controller/Sms.php new file mode 100644 index 00000000..e16f1e88 --- /dev/null +++ b/addon/cossms/admin/controller/Sms.php @@ -0,0 +1,48 @@ +isAjax()) { + $access_key_id = input("access_key_id", "");//access_key_id + $access_key_secret = input("access_key_secret", "");//access_key_secret + $smssign = input("smssign", '');//短信签名 + $status = input("status", 0);//启用状态 + $data = array( + "status" => $status, + "access_key_id" => $access_key_id, + "access_key_secret" => $access_key_secret, + "smssign" => $smssign + ); + $result = $config_model->setSmsConfig($data); + return $result; + } else { + $info_result = $config_model->getSmsConfig(); + $info = $info_result["data"]; + $this->assign("info", $info); + return $this->fetch("sms/config"); + } + } +} \ No newline at end of file diff --git a/addon/cossms/admin/view/message/edit.html b/addon/cossms/admin/view/message/edit.html new file mode 100644 index 00000000..42b9b487 --- /dev/null +++ b/addon/cossms/admin/view/message/edit.html @@ -0,0 +1,107 @@ +{extend name="../app/admin/view/base.html"/} +{block name="resources"} + +{/block} +{block name="main"} +
+
+ +
+ +
+
+ +
+ +
+ +
+
必须与短信接口的模板ID一致,否则无效!
+
+ +
+ +
+ {foreach $message_variable_list as $message_variable_k => $message_variable_v} + + {/foreach} +
+
+ +
+ +
+ +
+
变量只能使用上方的可用变量中的变量,否则不会被解析;如果要使用凌凯短信时,短信内容必须进行设置。
+
+ +
+ + +
+ +
+{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/addon/cossms/admin/view/sms/config.html b/addon/cossms/admin/view/sms/config.html new file mode 100644 index 00000000..51348a81 --- /dev/null +++ b/addon/cossms/admin/view/sms/config.html @@ -0,0 +1,84 @@ +{extend name="../app/admin/view/base.html"/} +{block name="resources"} + +{/block} +{block name="main"} +
+
+ +
+ +
+
当前使用腾讯云短信配置
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ + +
+
+{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/addon/cossms/config/diy_view.php b/addon/cossms/config/diy_view.php new file mode 100644 index 00000000..f564ab79 --- /dev/null +++ b/addon/cossms/config/diy_view.php @@ -0,0 +1,24 @@ + [ + 'view' => [ + ], + 'util' => [ + ], + 'link' => [ + ], + + ], +]; \ No newline at end of file diff --git a/addon/cossms/config/event.php b/addon/cossms/config/event.php new file mode 100644 index 00000000..8a039b80 --- /dev/null +++ b/addon/cossms/config/event.php @@ -0,0 +1,28 @@ + [], + 'listen' => [ + //展示活动 + 'ShowPromotion' => [ + 'addon\cossms\event\ShowPromotion', + ], + //短信方式 + 'SmsType' => [ + 'addon\cossms\event\SmsType' + ], + 'CloseSMS'=>[ + 'addon\cossms\event\CloseSMS' + ], + 'DoEditSmsMessage' => [ + 'addon\cossms\event\DoEditSmsMessage' + ], + 'SendSms' => [ + 'addon\cossms\event\SendSms' + ], + 'SmsTemplateInfo' => [ + 'addon\cossms\event\SmsTemplateInfo' + ] + ], + 'subscribe' => [], +]; diff --git a/addon/cossms/config/info.php b/addon/cossms/config/info.php new file mode 100644 index 00000000..1e600ef7 --- /dev/null +++ b/addon/cossms/config/info.php @@ -0,0 +1,21 @@ + 'cossms', + 'title' => '腾讯云短信', + 'description' => '腾讯云短信 SMS短信服务', + 'status' => 1, + 'author' => '', + 'version' => '1.0', + 'content' => '', +]; \ No newline at end of file diff --git a/addon/cossms/config/menu_admin.php b/addon/cossms/config/menu_admin.php new file mode 100644 index 00000000..7addc81c --- /dev/null +++ b/addon/cossms/config/menu_admin.php @@ -0,0 +1,29 @@ + 'COS_SMS_CONFIG', + 'title' => '腾讯短信配置', + 'url' => 'cossms://admin/sms/config', + 'parent' => 'SMS_MANAGE', + 'is_show' => 0, + 'is_control' => 1, + 'is_icon' => 0, + 'picture' => '', + 'picture_select' => '', + 'sort' => 1, + ], + [ + 'name' => 'MESSAGE_COSSMS_EDIT', + 'title' => '编辑短信模板', + 'url' => 'cossms://admin/message/edit', + 'parent' => 'MESSAGE_LISTS', + 'is_show' => 0, + 'picture' => '', + 'picture_select' => '', + 'sort' => 1, + 'child_list' => [], + ], +]; diff --git a/addon/cossms/config/menu_shop.php b/addon/cossms/config/menu_shop.php new file mode 100644 index 00000000..edc237e9 --- /dev/null +++ b/addon/cossms/config/menu_shop.php @@ -0,0 +1,29 @@ + 'COS_SMS_CONFIG', + 'title' => 'COS短信配置', + 'url' => 'cossms://shop/sms/config', + 'parent' => 'SMS_MANAGE', + 'is_show' => 0, + 'is_control' => 1, + 'is_icon' => 0, + 'picture' => '', + 'picture_select' => '', + 'sort' => 1, + ], + [ + 'name' => 'MESSAGE_COSSMS_EDIT', + 'title' => '编辑短信模板', + 'url' => 'cossms://shop/message/edit', + 'parent' => 'MESSAGE_LISTS', + 'is_show' => 0, + 'picture' => '', + 'picture_select' => '', + 'sort' => 1, + 'child_list' => [], + ], +]; diff --git a/addon/cossms/event/CloseSMS.php b/addon/cossms/event/CloseSMS.php new file mode 100644 index 00000000..53523d1e --- /dev/null +++ b/addon/cossms/event/CloseSMS.php @@ -0,0 +1,35 @@ +modifyConfigIsUse(0, $site_id,$app_module); + return $res; + } + } +} \ No newline at end of file diff --git a/addon/cossms/event/DoEditSmsMessage.php b/addon/cossms/event/DoEditSmsMessage.php new file mode 100644 index 00000000..72c03de9 --- /dev/null +++ b/addon/cossms/event/DoEditSmsMessage.php @@ -0,0 +1,42 @@ +siteid(); + $app_module='shop'; + if($param){ + if(isset($param['site_id'])) $site_id=$param['site_id']; + if(isset($param['app_module'])) $app_module=$param['app_module']; + } + $config_model = new ConfigModel(); + $config_result = $config_model->getSmsConfig($site_id,$app_module); + $config = $config_result["data"]; + if ($config["is_use"] == 1) { + return [ + "edit_url" => "cossms://{$app_module}/message/edit", + "shop_url" => "cossms://{$app_module}/message/edit", + "admin_url" => "cossms://{$app_module}/message/edit" + ]; + } + } +} \ No newline at end of file diff --git a/addon/cossms/event/Install.php b/addon/cossms/event/Install.php new file mode 100644 index 00000000..5456338d --- /dev/null +++ b/addon/cossms/event/Install.php @@ -0,0 +1,27 @@ +send($param); + return $res; + } +} \ No newline at end of file diff --git a/addon/cossms/event/ShowPromotion.php b/addon/cossms/event/ShowPromotion.php new file mode 100644 index 00000000..87de5e8c --- /dev/null +++ b/addon/cossms/event/ShowPromotion.php @@ -0,0 +1,65 @@ + [ + [ + //插件名称 + 'name' => 'cossms', + //展示分类(根据平台端设置,admin(平台营销),shop:店铺营销,member:会员营销, tool:应用工具) + 'show_type' => 'tool', + //展示主题 + 'title' => '腾讯COS短信', + //展示介绍 + 'description' => '腾讯云短信管理', + //展示图标 + 'icon' => 'addon/cossms/icon.png', + //跳转链接 + 'url' => 'cossms://admin/sms/config', + ] + ], + 'shop' => [ + [ + //插件名称 + 'name' => 'cossms', + //展示分类(根据平台端设置,admin(平台营销),shop:店铺营销,member:会员营销, tool:应用工具) + 'show_type' => 'tool', + //展示主题 + 'title' => '腾讯COS短信', + //展示介绍 + 'description' => '腾讯云短信管理', + //展示图标 + 'icon' => 'addon/cossms/icon.png', + //跳转链接 + 'url' => 'cossms://shop/sms/config', + ] + ] + ]; + return $data; + } +} \ No newline at end of file diff --git a/addon/cossms/event/SmsTemplateInfo.php b/addon/cossms/event/SmsTemplateInfo.php new file mode 100644 index 00000000..80d94ba8 --- /dev/null +++ b/addon/cossms/event/SmsTemplateInfo.php @@ -0,0 +1,38 @@ +getSmsConfig($site_id, $app_module); + $sms_config = $sms_config[ 'data' ]; + if ($sms_config['is_use']) { + $template_info = model('message_template')->getInfo([ ['keywords', '=', $param['keywords'] ]]); + if (!empty($template_info['sms_json'])) { + return json_decode($template_info['sms_json'], true); + } + } + } +} \ No newline at end of file diff --git a/addon/cossms/event/SmsType.php b/addon/cossms/event/SmsType.php new file mode 100644 index 00000000..38d5dfdc --- /dev/null +++ b/addon/cossms/event/SmsType.php @@ -0,0 +1,45 @@ +getSmsConfig($site_id,$app_module)['data']; + $info = array( + "sms_type" => "cossms", + "sms_type_name" => "腾讯云短信", + "status" => $config['is_use']??0, + "admin_url" => "cossms://{$app_module}/sms/config", + "edit_url" => "cossms://{$app_module}/sms/config", + "shop_url" => "cossms://{$app_module}/sms/config", + "desc" => "腾讯云短信(Short Message Service,SMS)沉淀腾讯十多年短信服务技术和经验,为 QQ、微信等亿级平台和10万+客户提供国内短信和国际/港澳台短信服务。国内短信验证秒级触达,99%到达率;国际/港澳台短信覆盖全球200+国家/地区,稳定可靠。腾讯云短信旨在帮助广大开发者快速灵活接入高质量的国内、国际/港澳台短信服务。" + ); + return $info; + } +} \ No newline at end of file diff --git a/addon/cossms/event/UnInstall.php b/addon/cossms/event/UnInstall.php new file mode 100644 index 00000000..b0d14df1 --- /dev/null +++ b/addon/cossms/event/UnInstall.php @@ -0,0 +1,29 @@ + 'cossms', 'is_use' => $is_use, 'site_id' => $site_id ,'app_module'=>$app_module]); + } + $res = $config->setConfig($data,'腾讯云短信配置',$is_use,[[ 'site_id', '=', $site_id ],[ 'app_module', '=',$app_module ], [ 'config_key', '=', 'COS_SMS_CONFIG' ] ]); + return $res; + } + + /** + * 获取短信配置 + */ + public function getSmsConfig($site_id=0,$app_module='shop') + { + $config = new ConfigModel(); + $res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'COS_SMS_CONFIG' ] ]); + return $res; + } + + + /** + * 设置开关 + */ + public function modifyConfigIsUse($is_use, $site_id = 1, $app_module = 'shop') + { + if($is_use){ + event('CloseSMS', ['sms_type' => 'cossms', 'is_use' => $is_use, 'site_id' => $site_id ,'app_module'=>$app_module]); + } + $config = new ConfigModel(); + $res = $config->modifyConfigIsUse($is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'COS_SMS_CONFIG' ] ]); + return $res; + } +} \ No newline at end of file diff --git a/addon/cossms/model/Sms.php b/addon/cossms/model/Sms.php new file mode 100644 index 00000000..d7f7a859 --- /dev/null +++ b/addon/cossms/model/Sms.php @@ -0,0 +1,81 @@ +getSmsConfig($site_id,$app_module); + if ($config_result["data"]["is_use"]) { + $config = $config_result["data"]["value"]; + $sms_info = $param["message_info"]["sms_json_array"];//消息类型模板 短信模板信息 + if (empty($sms_info)) return $this->error([], "消息模板尚未配置"); + $sms_info = $sms_info[ "cossms" ]; + $var_parse = $param["var_parse"];//变量解析 + $account = $param["sms_account"]??$param['mobile'];//发送手机号 + $template = $sms_info["template_id"]??'';//发送模板ID + //加入腾讯云短信配置 + $sms_config = [ + // HTTP 请求的超时时间(秒) + 'timeout' => 5.0, + // 默认发送配置 + 'default' => [ + // 网关调用策略,默认:顺序调用 + 'strategy' => OrderStrategy::class, + // 默认可用的发送网关 + 'gateways' => ['qcloud'], + ], + // 可用的网关配置 + 'gateways' => [ + 'qcloud' => [ + 'sdk_app_id' => $config["sdk_app_id"], // SDK APP ID + 'app_key' => $config["sdk_app_key"],// APP KEY + 'secret_id' =>$config['secret_id'], //'AKIDARZRAj9KGySjmaBalgbT8oaCau21nLgo', // SECRET ID + 'secret_key' =>$config['secret_key'], //'8DGOXYRBsS3b2Mdp15xb2W3RluqhNnzw', // SECRET KEY + 'sign_name' =>$config['smssign'] //'恒泰茶缘网络', // 短信签名 + ] + ], + ]; + try { + unset($var_parse['site_name']); + $easySms = new EasySms($sms_config); + $easySms->send($account, [ + 'template' => $template, // 模板ID + 'content' =>$sms_info["content"], // 模板内容 + 'data' => $var_parse + ]); + return $this->success([ "addon" => "cossms", "addon_name" => "腾讯云短信", "content" => $sms_info["content"] ]); + } catch (NoGatewayAvailableException $exception) { + $message = $exception->getException('qcloud')->getMessage(); + return $this->error([ "content" => $sms_info["content"] ], $message ? : '短信发送异常'); + } + } + } +} diff --git a/addon/cossms/shop/controller/Message.php b/addon/cossms/shop/controller/Message.php new file mode 100644 index 00000000..ac0ccc1a --- /dev/null +++ b/addon/cossms/shop/controller/Message.php @@ -0,0 +1,86 @@ +getMessageInfo($this->site_id, $keywords); + $info = $info_result["data"]; + if (request()->isAjax()) { + if (empty($info)) + return error("", "不存在的模板信息!"); + $sms_is_open = input('sms_is_open', 0); + $sms_json_array = !empty($info["sms_json_array"]) ? $info["sms_json_array"] : [];//短信配置 + $template_id = input("template_id", '');//短信模板id + $smssign = input("smssign", '');//短信签名 + $content = input("content", '');//短信签名 + + $cossms_array = []; + if (!empty($sms_json_array["cossms"])) { + $cossms_array = $sms_json_array["cossms"]; + } + $cossms_array['template_id'] = $template_id;//模板ID (备注:服务商提供的模板ID) + $cossms_array['content'] = $content;//模板内容 (备注:仅用于显示) + $cossms_array['smssign'] = $smssign;//短信签名 (备注:请填写短信签名(如果服务商是大于请填写审核成功的签名)) + $sms_json_array["cossms"] = $cossms_array; + $data = array( + 'sms_json' => json_encode($sms_json_array), + ); + $condition = array( + ["keywords", "=", $keywords] + ); + $template_model = new MessageTemplateModel(); + $res = $template_model->editMessageTemplate($data, $condition); + if ($res['code'] == 0) { + $res = $message_model->editMessage(['sms_is_open' => $sms_is_open, 'site_id' => $this->site_id, 'keywords' => $keywords], [ + ["keywords", "=", $keywords], + ['site_id', '=', $this->site_id], + ]); + } + return $res; + } else { + if (empty($info)) + $this->error("不存在的模板信息!"); + + $sms_json_array = $info["sms_json_array"];//短信配置 + $cossms_array = []; + if (!empty($sms_json_array["cossms"])) { + $cossms_array = $sms_json_array["cossms"]; + } + + $this->assign("info", $cossms_array); + $this->assign("keywords", $keywords); + + //模板变量 + $message_variable_list = $info["message_json_array"]; + $this->assign("message_variable_list", $message_variable_list); + + $this->assign('sms_is_open', $info['sms_is_open']); + return $this->fetch('message/edit'); + } + } + +} \ No newline at end of file diff --git a/addon/cossms/shop/controller/Sms.php b/addon/cossms/shop/controller/Sms.php new file mode 100644 index 00000000..172074b2 --- /dev/null +++ b/addon/cossms/shop/controller/Sms.php @@ -0,0 +1,47 @@ +isAjax()) { + $sdk_app_id = input("sdk_app_id", "");//sdk_app_id + $sdk_app_key = input("sdk_app_key", "");//sdk_app_key + $secret_id = input("secret_id", "");//secret_id + $secret_key = input("secret_key", "");//secret_key + $smssign = input("smssign", '');//短信签名 + $status = input("status", 0);//启用状态 + $data = array ( + "sdk_app_id" => $sdk_app_id, + "sdk_app_key" => $sdk_app_key, + "secret_id" => $secret_id, + "secret_key" => $secret_key, + "smssign" => $smssign + ); + $result = $config_model->setSmsConfig($data, $status, $this->site_id, $this->app_module); + return $result; + } else { + $info_result = $config_model->getSmsConfig($this->site_id, $this->app_module); + $info = $info_result[ "data" ]; + $this->assign("info", $info); + return $this->fetch("sms/config"); + } + } +} \ No newline at end of file diff --git a/addon/cossms/shop/view/message/edit.html b/addon/cossms/shop/view/message/edit.html new file mode 100644 index 00000000..4e8d4d8f --- /dev/null +++ b/addon/cossms/shop/view/message/edit.html @@ -0,0 +1,104 @@ +{extend name="app/shop/view/base.html"/} +{block name="resources"} + +{/block} +{block name="main"} +
+
+ +
+ +
+
+ +
+ +
+ +
+
必须与短信接口的模板ID一致,否则无效!
+
+ +
+ +
+ {foreach $message_variable_list as $message_variable_k => $message_variable_v} + + {/foreach} +
+
+ +
+ +
+ +
+
变量只能使用上方的可用变量中的变量,否则不会被解析;如果要使用凌凯短信时,短信内容必须进行设置。
+
+ +
+ + +
+ +
+{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/addon/cossms/shop/view/sms/config.html b/addon/cossms/shop/view/sms/config.html new file mode 100644 index 00000000..d246d742 --- /dev/null +++ b/addon/cossms/shop/view/sms/config.html @@ -0,0 +1,95 @@ +{extend name="app/shop/view/base.html"/} +{block name="resources"} + +{/block} +{block name="main"} +
+
+ +
+ +
+
当前使用腾讯云短信配置
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ + +
+
+{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/addon/futures/model/Forder.php b/addon/futures/model/Forder.php new file mode 100644 index 00000000..7790cac2 --- /dev/null +++ b/addon/futures/model/Forder.php @@ -0,0 +1,106 @@ +getBasicsConfig($site_id)['data']['value']; + if(!empty(model("fenxiao_order")->getValue(['order_id'=>$order[ 'order_id' ]],'fenxiao_order_id'))){ + return $this->success(); + } + //检测分销商上级关系 + $member_info = model("member")->getInfo([ [ 'member_id', '=', $order[ 'member_id' ] ] ], 'fenxiao_id,is_fenxiao'); + //如果没有分销商直接返回不计算,没有考虑首次付款上下级绑定 + if(empty($member_info)){ + return $this->success(); + } + if ($member_info[ 'fenxiao_id' ] == 0) { + return $this->success(); + } + + $fenxiao_id = $member_info[ 'fenxiao_id' ]; + $fenxiao_info = model("fenxiao")->getInfo([ [ 'fenxiao_id', '=', $fenxiao_id ], [ 'is_delete', '=', 0 ] ]); + if (empty($fenxiao_info)) { + return $this->success(); + } + + $parent_fenxiao_info = model('fenxiao')->getInfo([ [ 'fenxiao_id', '=', $fenxiao_info[ 'parent' ] ], [ 'is_delete', '=', 0 ] ], 'fenxiao_id, fenxiao_name, status, parent'); + + $direct_push=$basics['direct_push'];//直推 + $indirect_push=$basics['indirect_push'];//间推 + $is_range=$basics['is_range']; + if($is_range && $parent_fenxiao_info){ //减去极差奖励 + $direct_push -=$indirect_push; + } + $order_goods = model("order_goods")->getInfo(['order_id'=>$order[ 'order_id' ]]); + $commission_rate=$direct_push+$indirect_push; //总佣金比例 + $service_charge=$order['order_money']*$basics['service_price']/100;//总服务费 + $commission=$commission_rate*$service_charge/100;//总佣金 + $order_fenxiao_data = [ + 'one_rate' => $direct_push, + 'one_commission' =>$direct_push*$service_charge/100, + 'two_rate' => $indirect_push, + 'two_commission' => $indirect_push*$service_charge/100, + 'three_rate' => 0, + ]; + //启动分销 + $data = [ + 'order_id' => $order[ 'order_id' ], + 'order_no' => $order[ 'order_no' ], + 'order_goods_id' => $order_goods[ 'order_goods_id' ], + 'site_id' => $order[ 'site_id' ], + 'site_name' => $order[ 'site_name' ], + 'goods_id' => $order_goods[ 'goods_id' ], + 'sku_id' => $order_goods[ 'sku_id' ], + 'sku_name' => $order_goods[ 'sku_name' ], + 'sku_image' => $order_goods[ 'sku_image' ], + 'price' => $order[ 'order_money' ], + 'num' => $order_goods[ 'num' ], + 'real_goods_money' =>$order[ 'order_money' ], + 'member_id' => $order[ 'member_id' ], + 'member_name' => $order[ 'name' ], + 'member_mobile' => $order[ 'mobile' ], + 'full_address' => $order[ 'full_address' ] . $order[ 'address' ], + + 'commission' => $commission, + 'commission_rate' => $commission_rate, + + 'one_fenxiao_id' => empty($fenxiao_info) ? 0 : $fenxiao_info[ 'fenxiao_id' ], + 'one_rate' => empty($order_fenxiao_data[ 'one_rate' ]) ? 0 : $order_fenxiao_data[ 'one_rate' ], + 'one_commission' => empty($order_fenxiao_data[ 'one_commission' ]) ? 0 : $order_fenxiao_data[ 'one_commission' ], + 'one_fenxiao_name' => empty($fenxiao_info) ? '' : $fenxiao_info[ 'fenxiao_name' ], + + + 'two_fenxiao_id' => empty($parent_fenxiao_info) ? 0 : $parent_fenxiao_info[ 'fenxiao_id' ], + 'two_rate' => empty($order_fenxiao_data[ 'two_rate' ]) ? 0 : $order_fenxiao_data[ 'two_rate' ], + 'two_commission' => empty($order_fenxiao_data[ 'two_commission' ]) ? 0 : $order_fenxiao_data[ 'two_commission' ], + 'two_fenxiao_name' => empty($parent_fenxiao_info) ? '' : $parent_fenxiao_info[ 'fenxiao_name' ], + 'create_time' => time() + ]; + model("fenxiao_order")->add($data); + $fenxiao_order_model = new FenxiaoOrder(); + $fenxiao_order_model->settlement($data['order_id']); + $res = $fenxiao_order_model->calculateOrder($data['order_id']); + return $this->success(); + } +} \ No newline at end of file