|
@@ -3,1879 +3,2324 @@ defined('ONLY_ONLY_ONLY') or exit('Access Denied');
|
|
|
/*****************杂项实体逻辑相关******************/
|
|
|
|
|
|
/**********************平台配置相关逻辑**************************************/
|
|
|
-function bizbase_platConfigEntityHandle($subSystem, $handleMode, $baseUser, $ajaxdata, $GPC){
|
|
|
- switch($handleMode){
|
|
|
- case "fetchRecuritRule":
|
|
|
- $oldConfig = basecfg_getConfig("PLAT_PCWEB","RecuritRule");
|
|
|
+function bizbase_platConfigEntityHandle($subSystem, $handleMode, $baseUser, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ switch ($handleMode) {
|
|
|
+ case "fetchRecuritRule":
|
|
|
+ $oldConfig = basecfg_getConfig("PLAT_PCWEB", "RecuritRule");
|
|
|
return $oldConfig;
|
|
|
- break;
|
|
|
- case "fetchRecuritRuleByTrader":
|
|
|
- $oldConfig = bizbase_fetchBaseConfig("RecuritRule",true);
|
|
|
+ break;
|
|
|
+ case "fetchRecuritRuleByTrader":
|
|
|
+ $oldConfig = bizbase_fetchBaseConfig("RecuritRule", true);
|
|
|
return $oldConfig;
|
|
|
- break;
|
|
|
- case "updateRecuritRule":
|
|
|
- $cfgData=isset($ajaxdata["cfgData"])?$ajaxdata["cfgData"]:$GPC["cfgData"];
|
|
|
- if(empty($cfgData)) throw new GeneralException("","没有传递必要的cfgData参数");
|
|
|
- //$oldConfig = basecfg_getConfig("PLAT_PCWEB","RecuritRule");
|
|
|
- $CONFIGNAME="freeCount";
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ break;
|
|
|
+ case "updateRecuritRule":
|
|
|
+ $cfgData = isset($ajaxdata["cfgData"]) ? $ajaxdata["cfgData"] : $GPC["cfgData"];
|
|
|
+ if (empty($cfgData)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的cfgData参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ //$oldConfig = basecfg_getConfig("PLAT_PCWEB","RecuritRule");
|
|
|
+ $CONFIGNAME = "freeCount";
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
+
|
|
|
$cfgData[$CONFIGNAME] = intval($cfgData[$CONFIGNAME]);
|
|
|
- if($cfgData[$CONFIGNAME]<0) $cfgData[$CONFIGNAME]=0;
|
|
|
+ if ($cfgData[$CONFIGNAME] < 0) {
|
|
|
+ $cfgData[$CONFIGNAME] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ $CONFIGNAME = "freeCount2";
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
|
|
|
- $CONFIGNAME="freeCount2";
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
$cfgData[$CONFIGNAME] = intval($cfgData[$CONFIGNAME]);
|
|
|
- if($cfgData[$CONFIGNAME]<0) $cfgData[$CONFIGNAME]=0;
|
|
|
+ if ($cfgData[$CONFIGNAME] < 0) {
|
|
|
+ $cfgData[$CONFIGNAME] = 0;
|
|
|
+ }
|
|
|
|
|
|
- $CONFIGNAME="pricePer";
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
- $cfgData[$CONFIGNAME] = round(floatval($cfgData[$CONFIGNAME]),2);
|
|
|
- if($cfgData[$CONFIGNAME]<0) $cfgData[$CONFIGNAME]=0;
|
|
|
+ $CONFIGNAME = "pricePer";
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
|
|
|
- $CONFIGNAME="feeper_min";//每人招聘费用的最低额 feeper_min 至少1元
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
- $cfgData[$CONFIGNAME] = round(floatval($cfgData[$CONFIGNAME]),2);
|
|
|
- if($cfgData[$CONFIGNAME]<1) $cfgData[$CONFIGNAME]=1;
|
|
|
+ $cfgData[$CONFIGNAME] = round(floatval($cfgData[$CONFIGNAME]), 2);
|
|
|
+ if ($cfgData[$CONFIGNAME] < 0) {
|
|
|
+ $cfgData[$CONFIGNAME] = 0;
|
|
|
+ }
|
|
|
|
|
|
- $CONFIGNAME="enroll_premoney";//会员报名押金额 enroll_premoney
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
- $cfgData[$CONFIGNAME] = round(floatval($cfgData[$CONFIGNAME]),2);
|
|
|
- if($cfgData[$CONFIGNAME]<0) $cfgData[$CONFIGNAME]=0;
|
|
|
+ $CONFIGNAME = "feeper_min"; //每人招聘费用的最低额 feeper_min 至少1元
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
+
|
|
|
+ $cfgData[$CONFIGNAME] = round(floatval($cfgData[$CONFIGNAME]), 2);
|
|
|
+ if ($cfgData[$CONFIGNAME] < 1) {
|
|
|
+ $cfgData[$CONFIGNAME] = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ $CONFIGNAME = "enroll_premoney"; //会员报名押金额 enroll_premoney
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
+
|
|
|
+ $cfgData[$CONFIGNAME] = round(floatval($cfgData[$CONFIGNAME]), 2);
|
|
|
+ if ($cfgData[$CONFIGNAME] < 0) {
|
|
|
+ $cfgData[$CONFIGNAME] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ $CONFIGNAME = "plater_getrate"; //默认平台分成比例plater_getrate 每人招聘费用的百分比
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
|
|
|
- $CONFIGNAME="plater_getrate";//默认平台分成比例plater_getrate 每人招聘费用的百分比
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
$cfgData[$CONFIGNAME] = intval($cfgData[$CONFIGNAME]);
|
|
|
- if($cfgData[$CONFIGNAME]<0) $cfgData[$CONFIGNAME]=0;
|
|
|
- if($cfgData[$CONFIGNAME]>90) $cfgData[$CONFIGNAME]=90;
|
|
|
+ if ($cfgData[$CONFIGNAME] < 0) {
|
|
|
+ $cfgData[$CONFIGNAME] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($cfgData[$CONFIGNAME] > 90) {
|
|
|
+ $cfgData[$CONFIGNAME] = 90;
|
|
|
+ }
|
|
|
+
|
|
|
+ $CONFIGNAME = "share_getrate"; //默认分佣比例share_getrate 基于平台分成下的百分比
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
|
|
|
- $CONFIGNAME="share_getrate";//默认分佣比例share_getrate 基于平台分成下的百分比
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
$cfgData[$CONFIGNAME] = intval($cfgData[$CONFIGNAME]);
|
|
|
- if($cfgData[$CONFIGNAME]<0) $cfgData[$CONFIGNAME]=0;
|
|
|
- if($cfgData[$CONFIGNAME]>90) $cfgData[$CONFIGNAME]=90;
|
|
|
+ if ($cfgData[$CONFIGNAME] < 0) {
|
|
|
+ $cfgData[$CONFIGNAME] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($cfgData[$CONFIGNAME] > 90) {
|
|
|
+ $cfgData[$CONFIGNAME] = 90;
|
|
|
+ }
|
|
|
+
|
|
|
+ $CONFIGNAME = "tbreak_cutrate"; //商家违约会员的扣除比例tbreak_cutrate 基于每人招聘费用的百分比
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
|
|
|
- $CONFIGNAME="tbreak_cutrate";//商家违约会员的扣除比例tbreak_cutrate 基于每人招聘费用的百分比
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
$cfgData[$CONFIGNAME] = intval($cfgData[$CONFIGNAME]);
|
|
|
- if($cfgData[$CONFIGNAME]<0) $cfgData[$CONFIGNAME]=0;
|
|
|
- if($cfgData[$CONFIGNAME]>90) $cfgData[$CONFIGNAME]=90;
|
|
|
+ if ($cfgData[$CONFIGNAME] < 0) {
|
|
|
+ $cfgData[$CONFIGNAME] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($cfgData[$CONFIGNAME] > 90) {
|
|
|
+ $cfgData[$CONFIGNAME] = 90;
|
|
|
+ }
|
|
|
|
|
|
- $CONFIGNAME="enroll_overate";//溢报倍数enroll_overate //至少是1倍
|
|
|
- if(!isset($cfgData[$CONFIGNAME])) throw new GeneralException("","没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
- $cfgData[$CONFIGNAME] = round(floatval($cfgData[$CONFIGNAME]),2);
|
|
|
- if($cfgData[$CONFIGNAME]<1) $cfgData[$CONFIGNAME]=1;
|
|
|
+ $CONFIGNAME = "enroll_overate"; //溢报倍数enroll_overate //至少是1倍
|
|
|
+ if (!isset($cfgData[$CONFIGNAME])) {
|
|
|
+ throw new GeneralException("", "没有传递必要的{$CONFIGNAME}配置属性");
|
|
|
+ }
|
|
|
+
|
|
|
+ $cfgData[$CONFIGNAME] = round(floatval($cfgData[$CONFIGNAME]), 2);
|
|
|
+ if ($cfgData[$CONFIGNAME] < 1) {
|
|
|
+ $cfgData[$CONFIGNAME] = 1;
|
|
|
+ }
|
|
|
|
|
|
- basecfg_setConfig("PLAT_PCWEB","RecuritRule",$cfgData);
|
|
|
- $afterConfig = basecfg_getConfig("PLAT_PCWEB","RecuritRule");
|
|
|
+ basecfg_setConfig("PLAT_PCWEB", "RecuritRule", $cfgData);
|
|
|
+ $afterConfig = basecfg_getConfig("PLAT_PCWEB", "RecuritRule");
|
|
|
return $afterConfig;
|
|
|
- break;
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
-function bizbase_fetchBaseConfig($configName,$needVerify){
|
|
|
- switch($configName){
|
|
|
+function bizbase_fetchBaseConfig($configName, $needVerify)
|
|
|
+{
|
|
|
+ switch ($configName) {
|
|
|
case "RecuritRule":
|
|
|
- $oldConfig = basecfg_getConfig("PLAT_PCWEB","RecuritRule");
|
|
|
- if(empty($oldConfig)) throw new GeneralException("","还没有配置平台招聘规则");
|
|
|
- if(intval($oldConfig["freeCount"])<0) $oldConfig["freeCount"]=0;
|
|
|
- if(intval($oldConfig["freeCount2"])<0) $oldConfig["freeCount2"]=0;
|
|
|
- if(round(floatval($oldConfig["pricePer"]), 2)<0) $oldConfig["pricePer"]=0;
|
|
|
+ $oldConfig = basecfg_getConfig("PLAT_PCWEB", "RecuritRule");
|
|
|
+ if (empty($oldConfig)) {
|
|
|
+ throw new GeneralException("", "还没有配置平台招聘规则");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($oldConfig["freeCount"]) < 0) {
|
|
|
+ $oldConfig["freeCount"] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($oldConfig["freeCount2"]) < 0) {
|
|
|
+ $oldConfig["freeCount2"] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (round(floatval($oldConfig["pricePer"]), 2) < 0) {
|
|
|
+ $oldConfig["pricePer"] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
//每人招聘费用的最低额 feeper_min
|
|
|
- $oldConfig["feeper_min"]=round(floatval($oldConfig["feeper_min"]), 2);
|
|
|
+ $oldConfig["feeper_min"] = round(floatval($oldConfig["feeper_min"]), 2);
|
|
|
//会员报名押金额 enroll_premoney
|
|
|
- $oldConfig["enroll_premoney"]=round(floatval($oldConfig["enroll_premoney"]), 2);
|
|
|
- //默认平台分成比例plater_getrate 每人招聘费用的百分比
|
|
|
- $oldConfig["plater_getrate"]=intval($oldConfig["plater_getrate"]);
|
|
|
- //默认分佣比例share_getrate 基于平台分成下的百分比
|
|
|
- $oldConfig["share_getrate"]=intval($oldConfig["share_getrate"]);
|
|
|
- //商家违约会员的扣除比例tbreak_cutrate 基于每人招聘费用的百分比
|
|
|
- $oldConfig["tbreak_cutrate"]=intval($oldConfig["tbreak_cutrate"]);
|
|
|
+ $oldConfig["enroll_premoney"] = round(floatval($oldConfig["enroll_premoney"]), 2);
|
|
|
+ //默认平台分成比例plater_getrate 每人招聘费用的百分比
|
|
|
+ $oldConfig["plater_getrate"] = intval($oldConfig["plater_getrate"]);
|
|
|
+ //默认分佣比例share_getrate 基于平台分成下的百分比
|
|
|
+ $oldConfig["share_getrate"] = intval($oldConfig["share_getrate"]);
|
|
|
+ //商家违约会员的扣除比例tbreak_cutrate 基于每人招聘费用的百分比
|
|
|
+ $oldConfig["tbreak_cutrate"] = intval($oldConfig["tbreak_cutrate"]);
|
|
|
//溢报倍数enroll_overate //至少是1倍
|
|
|
- $oldConfig["enroll_overate"]=round(floatval($oldConfig["enroll_overate"]), 2);
|
|
|
+ $oldConfig["enroll_overate"] = round(floatval($oldConfig["enroll_overate"]), 2);
|
|
|
return $oldConfig;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的configName!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的configName!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**********************平台协议信息相关逻辑**************************************/
|
|
|
-function bizbase_agreementEntityHandle($fromSubSystem,$handleMode, $ajaxdata, $GPC){
|
|
|
- switch($handleMode){
|
|
|
+function bizbase_agreementEntityHandle($fromSubSystem, $handleMode, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ switch ($handleMode) {
|
|
|
case "fetch":
|
|
|
// $sql = "SELECT * FROM biz_todowork WHERE biz_recruitid = 473";
|
|
|
-// $res = pdo_fetch($sql,array());
|
|
|
-// var_dump($res);die;
|
|
|
+ // $res = pdo_fetch($sql,array());
|
|
|
+ // var_dump($res);die;
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- if (empty($bizId)) throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
- $backdata = pdo_fetch("select * from biz_common_agreement where id=" . intval($bizId));
|
|
|
- if(empty($backdata)) throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
- if (intval($backdata["deleted"]) != 0)
|
|
|
+ if (empty($bizId)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ $backdata = pdo_fetch("select * from biz_common_agreement where id=" . intval($bizId));
|
|
|
+ if (empty($backdata)) {
|
|
|
+ throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($backdata["deleted"]) != 0) {
|
|
|
throw new GeneralException("", "此记录已删除了,请核查后再处理!");
|
|
|
- //数据转换 //属性映射
|
|
|
- $backdata["picurls"]=json_decode($backdata["picurls"],true);
|
|
|
+ }
|
|
|
+
|
|
|
+ //数据转换 //属性映射
|
|
|
+ $backdata["picurls"] = json_decode($backdata["picurls"], true);
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "fetchall":
|
|
|
- $backdata = pdo_fetchall("select * from biz_common_agreement where `deleted`=0 order by id asc;");
|
|
|
- //数据转换 //属性映射
|
|
|
- foreach($backdata as &$data){
|
|
|
- $data["picurls"]=json_decode($data["picurls"],true);
|
|
|
- }
|
|
|
+ break;
|
|
|
+ case "fetchall":
|
|
|
+ $backdata = pdo_fetchall("select * from biz_common_agreement where `deleted`=0 order by id asc;");
|
|
|
+ //数据转换 //属性映射
|
|
|
+ foreach ($backdata as &$data) {
|
|
|
+ $data["picurls"] = json_decode($data["picurls"], true);
|
|
|
+ }
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "update":
|
|
|
+ break;
|
|
|
+ case "update":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- if (empty($bizId)) throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
- $title = isset($ajaxdata["title"]) ? $ajaxdata["title"] : $GPC["title"];
|
|
|
- $content = isset($ajaxdata["content"]) ? $ajaxdata["content"] : $GPC["content"];
|
|
|
- $picurls = isset($ajaxdata["picurls"]) ? $ajaxdata["picurls"] : $GPC["picurls"];
|
|
|
- $saveData=array();
|
|
|
- $saveData["title"]=trim($title);
|
|
|
- $saveData["content"]=trim($content);
|
|
|
- $saveData["picurls"]=json_encode($picurls);
|
|
|
+ if (empty($bizId)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ $title = isset($ajaxdata["title"]) ? $ajaxdata["title"] : $GPC["title"];
|
|
|
+ $content = isset($ajaxdata["content"]) ? $ajaxdata["content"] : $GPC["content"];
|
|
|
+ $picurls = isset($ajaxdata["picurls"]) ? $ajaxdata["picurls"] : $GPC["picurls"];
|
|
|
+ $saveData = array();
|
|
|
+ $saveData["title"] = trim($title);
|
|
|
+ $saveData["content"] = trim($content);
|
|
|
+ $saveData["picurls"] = json_encode($picurls);
|
|
|
$oldData = pdo_fetch("select * from biz_common_agreement where id=" . intval($bizId));
|
|
|
- if (empty($oldData)) throw new GeneralException("", "此id对应的记录不存在,请核查bizId是否正确!");
|
|
|
- $saveData["updatetime"]=time();
|
|
|
- $backdata = pdo_update("biz_common_agreement", $saveData,array("id"=>$bizId));
|
|
|
+ if (empty($oldData)) {
|
|
|
+ throw new GeneralException("", "此id对应的记录不存在,请核查bizId是否正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ $saveData["updatetime"] = time();
|
|
|
+ $backdata = pdo_update("biz_common_agreement", $saveData, array("id" => $bizId));
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**********************轮播图相关逻辑**************************************/
|
|
|
-function bizbase_cyclePicShowEntityHandle($fromSubSystem,$handleMode, $ajaxdata, $GPC){
|
|
|
- switch($handleMode){
|
|
|
+function bizbase_cyclePicShowEntityHandle($fromSubSystem, $handleMode, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ switch ($handleMode) {
|
|
|
case "fetch":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- if (empty($bizId)) throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
+ if (empty($bizId)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
+ }
|
|
|
+
|
|
|
$backdata = pdo_fetch("select brv.*
|
|
|
- ,bsr.title as bsr_title
|
|
|
+ ,bsr.title as bsr_title
|
|
|
,bma.title as bma_title
|
|
|
from biz_recruit_videopics brv
|
|
|
- left join biz_trader_recruit bsr on bsr.id=brv.biz_recruitid
|
|
|
+ left join biz_trader_recruit bsr on bsr.id=brv.biz_recruitid
|
|
|
left join biz_market_activity bma on bma.id=brv.biz_recruitid
|
|
|
- where brv.id=" . intval($bizId));
|
|
|
- if(empty($backdata)) throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
- if (intval($backdata["deleted"]) != 0)
|
|
|
+ where brv.id=" . intval($bizId));
|
|
|
+ if (empty($backdata)) {
|
|
|
+ throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($backdata["deleted"]) != 0) {
|
|
|
throw new GeneralException("", "此记录已删除了,请核查后再处理!");
|
|
|
- //数据转换 //属性映射
|
|
|
- $backdata["slideshowImg"]=$backdata["headpic"]; unset($backdata["headpic"]);
|
|
|
- $backdata["ofType"]=intval($backdata["catalog"]);
|
|
|
- $backdata["detailshowImg"]=$backdata["detailpic"]; unset($backdata["detailpic"]);
|
|
|
- $backdata["detailedIntroduction"]=$backdata["bsr_title"]; unset($backdata["bsr_title"]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //数据转换 //属性映射
|
|
|
+ $backdata["slideshowImg"] = $backdata["headpic"];unset($backdata["headpic"]);
|
|
|
+ $backdata["ofType"] = intval($backdata["catalog"]);
|
|
|
+ $backdata["detailshowImg"] = $backdata["detailpic"];unset($backdata["detailpic"]);
|
|
|
+ $backdata["detailedIntroduction"] = $backdata["bsr_title"];unset($backdata["bsr_title"]);
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "fetchall":
|
|
|
- case "fetchallAPP":
|
|
|
- $biz_catalog = isset($ajaxdata["biz_catalog"]) ? $ajaxdata["biz_catalog"] : $GPC["biz_catalog"];
|
|
|
+ break;
|
|
|
+ case "fetchall":
|
|
|
+ case "fetchallAPP":
|
|
|
+ $biz_catalog = isset($ajaxdata["biz_catalog"]) ? $ajaxdata["biz_catalog"] : $GPC["biz_catalog"];
|
|
|
$backdata = pdo_fetchall("select brv.*
|
|
|
,bsr.title as bsr_title
|
|
|
,bma.title as bma_title
|
|
|
from biz_recruit_videopics brv
|
|
|
- left join biz_trader_recruit bsr on bsr.id=brv.biz_recruitid
|
|
|
+ left join biz_trader_recruit bsr on bsr.id=brv.biz_recruitid
|
|
|
left join biz_market_activity bma on bma.id=brv.biz_recruitid
|
|
|
- where brv.`deleted`=0
|
|
|
- order by brv.id asc;",array(
|
|
|
- //":biz_catalog"=>intval($biz_catalog),
|
|
|
- ));
|
|
|
- foreach($backdata as &$item){
|
|
|
- if($handleMode=="fetchallAPP"){//APP端
|
|
|
- $item["headpic"]=WEBAPI_IMG_HOSTURL."".$item["headpic"];
|
|
|
- $item["detailpic"]=WEBAPI_IMG_HOSTURL."".$item["detailpic"];
|
|
|
- }else{
|
|
|
- //数据转换 //属性映射
|
|
|
- $item["slideshowImg"]=$item["headpic"]; unset($item["headpic"]);
|
|
|
- $item["ofType"]=intval($item["catalog"]);
|
|
|
- $item["detailshowImg"]=$item["detailpic"]; unset($item["detailpic"]);
|
|
|
- $item["detailedIntroduction"]=$item["bsr_title"]; unset($item["bsr_title"]);
|
|
|
- }
|
|
|
- }
|
|
|
+ where brv.`deleted`=0
|
|
|
+ order by brv.id asc;", array(
|
|
|
+ //":biz_catalog"=>intval($biz_catalog),
|
|
|
+ ));
|
|
|
+ foreach ($backdata as &$item) {
|
|
|
+ if ($handleMode == "fetchallAPP") { //APP端
|
|
|
+ $item["headpic"] = WEBAPI_IMG_HOSTURL . "" . $item["headpic"];
|
|
|
+ $item["detailpic"] = WEBAPI_IMG_HOSTURL . "" . $item["detailpic"];
|
|
|
+ } else {
|
|
|
+ //数据转换 //属性映射
|
|
|
+ $item["slideshowImg"] = $item["headpic"];unset($item["headpic"]);
|
|
|
+ $item["ofType"] = intval($item["catalog"]);
|
|
|
+ $item["detailshowImg"] = $item["detailpic"];unset($item["detailpic"]);
|
|
|
+ $item["detailedIntroduction"] = $item["bsr_title"];unset($item["bsr_title"]);
|
|
|
+ }
|
|
|
+ }
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "upsert":
|
|
|
+ break;
|
|
|
+ case "upsert":
|
|
|
$bizData = isset($ajaxdata["bizData"]) ? $ajaxdata["bizData"] : $GPC["bizData"];
|
|
|
- if (empty($bizData)) throw new GeneralException("", "没有传递必要的bizData参数");
|
|
|
+ if (empty($bizData)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的bizData参数");
|
|
|
+ }
|
|
|
+
|
|
|
//属性映射 //数据转换
|
|
|
/***字段参数收集并校验**start***/
|
|
|
- $saveData=array();
|
|
|
+ $saveData = array();
|
|
|
|
|
|
- $saveData["biz_catalog"]=intval($bizData["biz_catalog"]);//0-招聘轮播图;1-活动轮播图;
|
|
|
- $saveData["headpic"]=trim($bizData["slideshowImg"]);
|
|
|
- if(empty($saveData["headpic"])) throw new GeneralException("", "轮播图不能为空!");
|
|
|
- $saveData["catalog"]=intval($bizData["ofType"]);//0-独立宣传页;1-关联招聘记录;
|
|
|
- switch($saveData["catalog"]){
|
|
|
+ $saveData["biz_catalog"] = intval($bizData["biz_catalog"]); //0-招聘轮播图;1-活动轮播图;
|
|
|
+ $saveData["headpic"] = trim($bizData["slideshowImg"]);
|
|
|
+ if (empty($saveData["headpic"])) {
|
|
|
+ throw new GeneralException("", "轮播图不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ $saveData["catalog"] = intval($bizData["ofType"]); //0-独立宣传页;1-关联招聘记录;
|
|
|
+ switch ($saveData["catalog"]) {
|
|
|
case 3:
|
|
|
- $saveData["detailpic"]=trim($bizData["detailshowImg"]);
|
|
|
- if(empty($saveData["detailpic"])) throw new GeneralException("", "宣传页不能为空!");
|
|
|
+ $saveData["detailpic"] = trim($bizData["detailshowImg"]);
|
|
|
+ if (empty($saveData["detailpic"])) {
|
|
|
+ throw new GeneralException("", "宣传页不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
default:
|
|
|
- $saveData["biz_recruitid"]=intval($bizData["biz_recruitid"]);
|
|
|
- if($saveData["biz_recruitid"]<=0) throw new GeneralException("", "关联的信息记录ID不能为空!");
|
|
|
+ $saveData["biz_recruitid"] = intval($bizData["biz_recruitid"]);
|
|
|
+ if ($saveData["biz_recruitid"] <= 0) {
|
|
|
+ throw new GeneralException("", "关联的信息记录ID不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
- }
|
|
|
+ }
|
|
|
/***字段参数收集并校验**finish***/
|
|
|
- if(intval($bizData["id"])<=0){
|
|
|
- $saveData["createtime"]=time();
|
|
|
- $insertId = pdo_insert("biz_recruit_videopics",$saveData);
|
|
|
- if (intval($insertId)<=0) throw new GeneralException("", "没有返回insertId,插入失败!");
|
|
|
+ if (intval($bizData["id"]) <= 0) {
|
|
|
+ $saveData["createtime"] = time();
|
|
|
+ $insertId = pdo_insert("biz_recruit_videopics", $saveData);
|
|
|
+ if (intval($insertId) <= 0) {
|
|
|
+ throw new GeneralException("", "没有返回insertId,插入失败!");
|
|
|
+ }
|
|
|
+
|
|
|
return $insertId;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$oldData = pdo_fetch("select `id` from biz_recruit_videopics where id=" . intval($bizData["id"]));
|
|
|
- if (empty($oldData)) throw new GeneralException("", "此id对应的记录不存在,请核查bizId是否正确!");
|
|
|
- $saveData["updatetime"]=time();
|
|
|
- $backdata = pdo_update("biz_recruit_videopics", $saveData,array("id"=>$bizData["id"]));
|
|
|
+ if (empty($oldData)) {
|
|
|
+ throw new GeneralException("", "此id对应的记录不存在,请核查bizId是否正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ $saveData["updatetime"] = time();
|
|
|
+ $backdata = pdo_update("biz_recruit_videopics", $saveData, array("id" => $bizData["id"]));
|
|
|
return $backdata;
|
|
|
- }
|
|
|
- break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**********************次数账户相关逻辑**************************************/
|
|
|
-function bizbase_naccountEntityHandle($fromSubSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- switch($handleMode){
|
|
|
+function bizbase_naccountEntityHandle($fromSubSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($handleMode) {
|
|
|
case "buyPrepay":
|
|
|
- //---------------------------------------
|
|
|
+ //---------------------------------------
|
|
|
$buyCount = isset($ajaxdata["buyCount"]) ? $ajaxdata["buyCount"] : $GPC["buyCount"];
|
|
|
- if (intval($buyCount)<=0) throw new GeneralException("", "buyCount购买次数不能为空啊");
|
|
|
- $recuritRule = bizbase_fetchBaseConfig("RecuritRule",true);
|
|
|
- $pricePer = round(floatval($recuritRule["pricePer"]), 2);
|
|
|
+ if (intval($buyCount) <= 0) {
|
|
|
+ throw new GeneralException("", "buyCount购买次数不能为空啊");
|
|
|
+ }
|
|
|
+
|
|
|
+ $recuritRule = bizbase_fetchBaseConfig("RecuritRule", true);
|
|
|
+ $pricePer = round(floatval($recuritRule["pricePer"]), 2);
|
|
|
$payTotal = round($buyCount * $pricePer, 2);
|
|
|
- if ($payTotal <= 0) throw new GeneralException("", "购买金额竟然小于等于0");
|
|
|
- // $backdata = pdo_fetch("select
|
|
|
- // (sum(case when bta.type=0 then ifnull(money,0) else 0 end)-
|
|
|
+ if ($payTotal <= 0) {
|
|
|
+ throw new GeneralException("", "购买金额竟然小于等于0");
|
|
|
+ }
|
|
|
+
|
|
|
+ // $backdata = pdo_fetch("select
|
|
|
+ // (sum(case when bta.type=0 then ifnull(money,0) else 0 end)-
|
|
|
// sum(case when bta.type=1 then ifnull(money,0) else 0 end)) as money_balance
|
|
|
// from biz_trader_account bta
|
|
|
- // where bta.deleted=0 and bta.biz_traderid=:biz_traderid
|
|
|
- // and bta.`biz_roletype`=:money_roletype and bta.biz_userid=:money_userid
|
|
|
+ // where bta.deleted=0 and bta.biz_traderid=:biz_traderid
|
|
|
+ // and bta.`biz_roletype`=:money_roletype and bta.biz_userid=:money_userid
|
|
|
// and bta.`status`=1",array(
|
|
|
// ":biz_traderid"=>$bizTrader["id"],
|
|
|
// ":money_userid"=>$bizTrader["id"],
|
|
|
// ":money_roletype"=>0,
|
|
|
// ));
|
|
|
// $money_balance = round(floatval($backdata["money_balance"]), 2);
|
|
|
- $accountInfo=bizbase_traderAccountInfo($bizTrader);
|
|
|
- $money_balance =round(floatval($accountInfo["balance"]), 2);
|
|
|
+ $accountInfo = bizbase_traderAccountInfo($bizTrader);
|
|
|
+ $money_balance = round(floatval($accountInfo["balance"]), 2);
|
|
|
$nowPayMoney = round(floatval($payTotal - $money_balance), 2);
|
|
|
- eeglobal_log_handler('numpaySettle','info'," money_balance={$money_balance} payTotal={$payTotal} paymoney={$nowPayMoney} ");
|
|
|
- if ($nowPayMoney <= 0) $nowPayMoney = 0;//将来在收支明细中过滤掉money=0的记录;
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":nowtime"]=time();
|
|
|
- $sqlParam[":biz_traderid"]=intval($bizTrader["id"]);
|
|
|
- $sqlParam[":buyCount"]=intval($buyCount);
|
|
|
- $sqlParam[":pricePer"]=$pricePer;
|
|
|
- $sqlParam[":paymoney"]=$nowPayMoney;
|
|
|
- $sqlParam[":money"]=$payTotal;
|
|
|
- $sqlParam[":paypreno"]="CS".date("YmdHis",time())."ID";
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" insert into biz_trader_numaccount set createtime=:nowtime";
|
|
|
- $sqlTemp.=" ,biz_traderid=:biz_traderid ";
|
|
|
- $sqlTemp.=" ,type=0,biz_catalog=0,biz_id=0,`status`=0,`count`=:buyCount,`pricePer`=:pricePer,`paymoney`=:paymoney,`money`=:money";
|
|
|
- $sqlTemp.=" ,remark='购买次数';";
|
|
|
- $sqlTemp.=" update biz_trader_numaccount set biz_idtag=concat(:paypreno,LAST_INSERT_ID()) where id=LAST_INSERT_ID(); ";
|
|
|
- $sqlTemp.=" select * from biz_trader_numaccount where id=LAST_INSERT_ID();";
|
|
|
+ eeglobal_log_handler('numpaySettle', 'info', " money_balance={$money_balance} payTotal={$payTotal} paymoney={$nowPayMoney} ");
|
|
|
+ if ($nowPayMoney <= 0) {
|
|
|
+ $nowPayMoney = 0;
|
|
|
+ }
|
|
|
+//将来在收支明细中过滤掉money=0的记录;
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":nowtime"] = time();
|
|
|
+ $sqlParam[":biz_traderid"] = intval($bizTrader["id"]);
|
|
|
+ $sqlParam[":buyCount"] = intval($buyCount);
|
|
|
+ $sqlParam[":pricePer"] = $pricePer;
|
|
|
+ $sqlParam[":paymoney"] = $nowPayMoney;
|
|
|
+ $sqlParam[":money"] = $payTotal;
|
|
|
+ $sqlParam[":paypreno"] = "CS" . date("YmdHis", time()) . "ID";
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " insert into biz_trader_numaccount set createtime=:nowtime";
|
|
|
+ $sqlTemp .= " ,biz_traderid=:biz_traderid ";
|
|
|
+ $sqlTemp .= " ,type=0,biz_catalog=0,biz_id=0,`status`=0,`count`=:buyCount,`pricePer`=:pricePer,`paymoney`=:paymoney,`money`=:money";
|
|
|
+ $sqlTemp .= " ,remark='购买次数';";
|
|
|
+ $sqlTemp .= " update biz_trader_numaccount set biz_idtag=concat(:paypreno,LAST_INSERT_ID()) where id=LAST_INSERT_ID(); ";
|
|
|
+ $sqlTemp .= " select * from biz_trader_numaccount where id=LAST_INSERT_ID();";
|
|
|
$dataset = pdo_query3($sqlTemp, $sqlParam);
|
|
|
- $bizInfo= $dataset[count($dataset)-1][0];
|
|
|
- if (empty($bizInfo)) throw new GeneralException("", "构建次数支付订单异常");
|
|
|
+ $bizInfo = $dataset[count($dataset) - 1][0];
|
|
|
+ if (empty($bizInfo)) {
|
|
|
+ throw new GeneralException("", "构建次数支付订单异常");
|
|
|
+ }
|
|
|
+
|
|
|
$payBizCatalog = "0"; //0-次数购买业务
|
|
|
$payBizId = $bizInfo["id"];
|
|
|
$payScene = "JSAPI";
|
|
|
- $prePayArgs = array(
|
|
|
+ $prePayArgs = array(
|
|
|
"payBackBizCatalog" => $payBizCatalog,
|
|
|
"payBackBizId" => $payBizId,
|
|
|
"payScene" => $payScene,
|
|
|
);
|
|
|
- if ($nowPayMoney <= 0) {
|
|
|
+ if ($nowPayMoney <= 0) {
|
|
|
bizbase_paySuccess($payBizCatalog, $payBizId, false);
|
|
|
return array("payResult" => true);
|
|
|
} else {
|
|
|
- //---------------------------------------
|
|
|
- $minaCode = isset($ajaxdata["minaCode"]) ? $ajaxdata["minaCode"] : $GPC["minaCode"];
|
|
|
- if (empty(trim($minaCode))) throw new GeneralException("", "没有传递必要的minaCode参数");
|
|
|
- $bizArgs=array(
|
|
|
- "minaCode"=>$minaCode,
|
|
|
- "bizInfo"=>$bizInfo,
|
|
|
- "bizTrader"=>$bizTrader,
|
|
|
+ //---------------------------------------
|
|
|
+ $minaCode = isset($ajaxdata["minaCode"]) ? $ajaxdata["minaCode"] : $GPC["minaCode"];
|
|
|
+ if (empty(trim($minaCode))) {
|
|
|
+ throw new GeneralException("", "没有传递必要的minaCode参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ $bizArgs = array(
|
|
|
+ "minaCode" => $minaCode,
|
|
|
+ "bizInfo" => $bizInfo,
|
|
|
+ "bizTrader" => $bizTrader,
|
|
|
);
|
|
|
- require_once WEB_PHY_ROOT."/base/wxsrv.php";
|
|
|
- $prePayInfo=weixin_prepayBuildV3($prePayArgs,$bizArgs,function($bizCatalog, $bizId, $bizArgs){
|
|
|
+ require_once WEB_PHY_ROOT . "/base/wxsrv.php";
|
|
|
+ $prePayInfo = weixin_prepayBuildV3($prePayArgs, $bizArgs, function ($bizCatalog, $bizId, $bizArgs) {
|
|
|
$minaCode = $bizArgs["minaCode"];
|
|
|
$bizInfo = $bizArgs["bizInfo"];
|
|
|
$bizTrader = $bizArgs["bizTrader"];
|
|
|
- $prePayInfo= array();
|
|
|
- switch($bizCatalog){
|
|
|
+ $prePayInfo = array();
|
|
|
+ switch ($bizCatalog) {
|
|
|
default:
|
|
|
- //---------------------------------------
|
|
|
+ //---------------------------------------
|
|
|
$resObj = bizwx_fetchMinaOpenidCore(SUBSYS_CAPITAL_MINA);
|
|
|
$wxmina_appid = $resObj["wxmina_appid"];
|
|
|
- $wxmina_openid = $resObj["openid"];
|
|
|
+ $wxmina_openid = $resObj["openid"];
|
|
|
$payTotal = round(floatval($bizInfo["paymoney"]), 2);
|
|
|
- if ($payTotal <= 0) throw new GeneralException("", "购买金额竟然小于等于0");
|
|
|
- $payTotal = $payTotal * 100;//转为分
|
|
|
+ if ($payTotal <= 0) {
|
|
|
+ throw new GeneralException("", "购买金额竟然小于等于0");
|
|
|
+ }
|
|
|
+
|
|
|
+ $payTotal = $payTotal * 100; //转为分
|
|
|
//---------------------------------------
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":id"]=intval($bizInfo["id"]);
|
|
|
- $sqlParam[":wxmina_appid"]=$wxmina_appid;
|
|
|
- $sqlParam[":wxmina_openid"]=$wxmina_openid;
|
|
|
- $sqlTemp=" update biz_trader_numaccount set";
|
|
|
- $sqlTemp.=" wxmina_appid=:wxmina_appid,wxmina_openid=:wxmina_openid ";
|
|
|
- $sqlTemp.=" where id=:id; ";
|
|
|
- $dataset = pdo_query3($sqlTemp, $sqlParam);
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":id"] = intval($bizInfo["id"]);
|
|
|
+ $sqlParam[":wxmina_appid"] = $wxmina_appid;
|
|
|
+ $sqlParam[":wxmina_openid"] = $wxmina_openid;
|
|
|
+ $sqlTemp = " update biz_trader_numaccount set";
|
|
|
+ $sqlTemp .= " wxmina_appid=:wxmina_appid,wxmina_openid=:wxmina_openid ";
|
|
|
+ $sqlTemp .= " where id=:id; ";
|
|
|
+ $dataset = pdo_query3($sqlTemp, $sqlParam);
|
|
|
//---------------------------------------
|
|
|
- $prePayInfo["appid"]=$wxmina_appid;
|
|
|
- $prePayInfo["mchId"]=WeiXinPay_mchId;
|
|
|
- $prePayInfo["mch_paykeyV2"]=WeiXinPay_apiKey;
|
|
|
- $prePayInfo["mch_paykeyV3"]=WeiXinPay_apiKeyV3;
|
|
|
- $prePayInfo["out_trade_no"]=$bizInfo["biz_idtag"];
|
|
|
- $prePayInfo["total"]="{$payTotal}";
|
|
|
- $prePayInfo["description"]="购买发布人次";
|
|
|
- $prePayInfo["openid"]=$wxmina_openid;
|
|
|
+ $prePayInfo["appid"] = $wxmina_appid;
|
|
|
+ $prePayInfo["mchId"] = WeiXinPay_mchId;
|
|
|
+ $prePayInfo["mch_paykeyV2"] = WeiXinPay_apiKey;
|
|
|
+ $prePayInfo["mch_paykeyV3"] = WeiXinPay_apiKeyV3;
|
|
|
+ $prePayInfo["out_trade_no"] = $bizInfo["biz_idtag"];
|
|
|
+ $prePayInfo["total"] = "{$payTotal}";
|
|
|
+ $prePayInfo["description"] = "购买发布人次";
|
|
|
+ $prePayInfo["openid"] = $wxmina_openid;
|
|
|
break;
|
|
|
}
|
|
|
return $prePayInfo;
|
|
|
- });
|
|
|
- }
|
|
|
- $prePayInfo =array_merge($prePayArgs, $prePayInfo);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ $prePayInfo = array_merge($prePayArgs, $prePayInfo);
|
|
|
return $prePayInfo;
|
|
|
- break;
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**********************微信相关逻辑**************************************/
|
|
|
-function bizbase_weixinEntityHandle($fromSubSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- switch($handleMode){
|
|
|
+function bizbase_weixinEntityHandle($fromSubSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($handleMode) {
|
|
|
case "confirmPaySuccess":
|
|
|
$payBizCatalog = isset($ajaxdata["payBizCatalog"]) ? $ajaxdata["payBizCatalog"] : $GPC["payBizCatalog"];
|
|
|
$payBizId = isset($ajaxdata["payBizId"]) ? $ajaxdata["payBizId"] : $GPC["payBizId"];
|
|
|
$backdata = bizbase_paySuccess($payBizCatalog, $payBizId, true);
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**********************资金账相关逻辑**************************************/
|
|
|
-function bizbase_accountEntityHandle($subSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL2_MINA) $bizTrader2 = $bizUser;
|
|
|
+function bizbase_accountEntityHandle($subSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL2_MINA) {
|
|
|
+ $bizTrader2 = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
$subSystem = intval($baseUser["subsystem"]);
|
|
|
- switch($handleMode){
|
|
|
- case "withdrawByWorker":
|
|
|
+ switch ($handleMode) {
|
|
|
+ case "withdrawByWorker":
|
|
|
$lockid = $bizWorker["id"];
|
|
|
- $todo = isset($ajaxdata["todo"]) ? $ajaxdata["todo"] : $GPC["todo"];
|
|
|
- $money = isset($ajaxdata["money"]) ? $ajaxdata["money"] : $GPC["money"];
|
|
|
+ $todo = isset($ajaxdata["todo"]) ? $ajaxdata["todo"] : $GPC["todo"];
|
|
|
+ $money = isset($ajaxdata["money"]) ? $ajaxdata["money"] : $GPC["money"];
|
|
|
$trueName = isset($ajaxdata["trueName"]) ? $ajaxdata["trueName"] : $GPC["trueName"];
|
|
|
$minaCode = isset($ajaxdata["minaCode"]) ? $ajaxdata["minaCode"] : $GPC["minaCode"];
|
|
|
- $params = array("subSystem"=>$subSystem, "bizWorker" => $bizWorker, "todo" => $todo, "money" => $money,"trueName"=>$trueName,"minaCode"=>$minaCode);
|
|
|
+ $params = array("subSystem" => $subSystem, "bizWorker" => $bizWorker, "todo" => $todo, "money" => $money, "trueName" => $trueName, "minaCode" => $minaCode);
|
|
|
$result = biz_flkForWorker($lockid, $params, function ($params) {
|
|
|
$subSystem = $params["subSystem"];
|
|
|
$bizWorker = $params["bizWorker"];
|
|
|
- $todo = $params["todo"];
|
|
|
+ $todo = $params["todo"];
|
|
|
$money = $params["money"];
|
|
|
$trueName = $params["trueName"];
|
|
|
$minaCode = $params["minaCode"];
|
|
|
- switch(trim($todo)){
|
|
|
+ switch (trim($todo)) {
|
|
|
case "all":
|
|
|
- $accountInfo=bizbase_workerAccountInfo($bizWorker);
|
|
|
+ $accountInfo = bizbase_workerAccountInfo($bizWorker);
|
|
|
$money = round(floatval($accountInfo["balance"]), 2);
|
|
|
break;
|
|
|
- case "part":
|
|
|
- $money = round(floatval($money), 2);
|
|
|
+ case "part":
|
|
|
+ $money = round(floatval($money), 2);
|
|
|
break;
|
|
|
- default:throw new GeneralException("","不支持的todo!");
|
|
|
+ default:throw new GeneralException("", "不支持的todo!");
|
|
|
}
|
|
|
- bizbase_accountWithdrawCheck($subSystem, $bizWorker, $money);
|
|
|
- require_once WEB_PHY_ROOT."/base/wxsrv.php";
|
|
|
+ bizbase_accountWithdrawCheck($subSystem, $bizWorker, $money);
|
|
|
+ require_once WEB_PHY_ROOT . "/base/wxsrv.php";
|
|
|
$resObj = bizwx_fetchMinaOpenidCore(SUBSYS_LABOUR_MINA);
|
|
|
$wxmina_appid = $resObj["wxmina_appid"];
|
|
|
- $wxmina_openid = $resObj["openid"];
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":nowtime"]=time();
|
|
|
- $sqlParam[":biz_workerid"]=$bizWorker["id"];
|
|
|
- $sqlParam[":wxmina_appid"]=$wxmina_appid;
|
|
|
- $sqlParam[":wxmina_openid"]=$wxmina_openid;
|
|
|
- $sqlParam[":money"]=$money;
|
|
|
+ $wxmina_openid = $resObj["openid"];
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":nowtime"] = time();
|
|
|
+ $sqlParam[":biz_workerid"] = $bizWorker["id"];
|
|
|
+ $sqlParam[":wxmina_appid"] = $wxmina_appid;
|
|
|
+ $sqlParam[":wxmina_openid"] = $wxmina_openid;
|
|
|
+ $sqlParam[":money"] = $money;
|
|
|
$sqlParam[":prefix"] = "TX" . date("YmdHis", time()) . "ID";
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" insert into biz_worker_account set createtime=:nowtime ";
|
|
|
- $sqlTemp.=" ,biz_workerid=:biz_workerid ";
|
|
|
- $sqlTemp.=" ,type=1, biz_catalog=0, money=:money ";
|
|
|
- $sqlTemp.=" ,wxmina_appid=:wxmina_appid, wxmina_openid=:wxmina_openid; ";
|
|
|
- $sqlTemp.=" update biz_worker_account set biz_idtag=concat(:prefix,id) where id=LAST_INSERT_ID(); ";
|
|
|
- $sqlTemp.=" select * from biz_worker_account where id=LAST_INSERT_ID(); ";
|
|
|
- $dataset=pdo_query3($sqlTemp,$sqlParam);
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " insert into biz_worker_account set createtime=:nowtime ";
|
|
|
+ $sqlTemp .= " ,biz_workerid=:biz_workerid ";
|
|
|
+ $sqlTemp .= " ,type=1, biz_catalog=0, money=:money ";
|
|
|
+ $sqlTemp .= " ,wxmina_appid=:wxmina_appid, wxmina_openid=:wxmina_openid; ";
|
|
|
+ $sqlTemp .= " update biz_worker_account set biz_idtag=concat(:prefix,id) where id=LAST_INSERT_ID(); ";
|
|
|
+ $sqlTemp .= " select * from biz_worker_account where id=LAST_INSERT_ID(); ";
|
|
|
+ $dataset = pdo_query3($sqlTemp, $sqlParam);
|
|
|
$account = $dataset[count($dataset) - 1][0];
|
|
|
- $insertId=intval($account["id"]);
|
|
|
- $withdrawNO=trim($account["biz_idtag"]);
|
|
|
- try{
|
|
|
+ $insertId = intval($account["id"]);
|
|
|
+ $withdrawNO = trim($account["biz_idtag"]);
|
|
|
+ try {
|
|
|
$trueName = empty($trueName) ? $bizWorker["true_name"] : $trueName;
|
|
|
- $remark = "会员快来优钱包提现";
|
|
|
- include_once WEB_PHY_ROOT."/base/wxsrv.php";
|
|
|
+ $remark = "会员快来优钱包提现";
|
|
|
+ include_once WEB_PHY_ROOT . "/base/wxsrv.php";
|
|
|
$transResult = weixin_transfers($wxmina_appid, $wxmina_openid, $withdrawNO, $trueName, $money * 100, $remark);
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":id"]=$insertId;
|
|
|
- $sqlParam[":nowtime"]=time();
|
|
|
- $sqlParam[":remark"] = "[" . date("Y-m-d H:i:s", time()) . "] 提现成功 \n";
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" update biz_worker_account set updatetime=:nowtime ";
|
|
|
- $sqlTemp.=" ,`status`=1 ,remark=concat(:remark,ifnull(remark,'')) ";
|
|
|
- $sqlTemp.=" where id=:id;";
|
|
|
- $backdata= pdo_query($sqlTemp,$sqlParam);
|
|
|
- return $transResult;
|
|
|
- }catch(Throwable $ex){
|
|
|
- throw new GeneralException("", "提现异常" . $ex->getMessage());
|
|
|
- }
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":id"] = $insertId;
|
|
|
+ $sqlParam[":nowtime"] = time();
|
|
|
+ $sqlParam[":remark"] = "[" . date("Y-m-d H:i:s", time()) . "] 提现成功 \n";
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " update biz_worker_account set updatetime=:nowtime ";
|
|
|
+ $sqlTemp .= " ,`status`=1 ,remark=concat(:remark,ifnull(remark,'')) ";
|
|
|
+ $sqlTemp .= " where id=:id;";
|
|
|
+ $backdata = pdo_query($sqlTemp, $sqlParam);
|
|
|
+ return $transResult;
|
|
|
+ } catch (Throwable $ex) {
|
|
|
+ throw new GeneralException("", "提现异常" . $ex->getMessage());
|
|
|
+ }
|
|
|
});
|
|
|
return $result;
|
|
|
break;
|
|
|
- case "withdrawByTrader":
|
|
|
+ case "withdrawByTrader":
|
|
|
$lockid = $bizTrader["id"];
|
|
|
- $todo = isset($ajaxdata["todo"]) ? $ajaxdata["todo"] : $GPC["todo"];
|
|
|
- $money = isset($ajaxdata["money"]) ? $ajaxdata["money"] : $GPC["money"];
|
|
|
+ $todo = isset($ajaxdata["todo"]) ? $ajaxdata["todo"] : $GPC["todo"];
|
|
|
+ $money = isset($ajaxdata["money"]) ? $ajaxdata["money"] : $GPC["money"];
|
|
|
$trueName = isset($ajaxdata["trueName"]) ? $ajaxdata["trueName"] : $GPC["trueName"];
|
|
|
$minaCode = isset($ajaxdata["minaCode"]) ? $ajaxdata["minaCode"] : $GPC["minaCode"];
|
|
|
- $params = array("subSystem"=>$subSystem, "bizTrader" => $bizTrader, "todo" => $todo, "money" => $money,"trueName"=>$trueName,"minaCode"=>$minaCode);
|
|
|
+ $params = array("subSystem" => $subSystem, "bizTrader" => $bizTrader, "todo" => $todo, "money" => $money, "trueName" => $trueName, "minaCode" => $minaCode);
|
|
|
$result = biz_flkForTrader($lockid, $params, function ($params) {
|
|
|
$subSystem = $params["subSystem"];
|
|
|
$bizTrader = $params["bizTrader"];
|
|
|
- $todo = $params["todo"];
|
|
|
+ $todo = $params["todo"];
|
|
|
$money = $params["money"];
|
|
|
$trueName = $params["trueName"];
|
|
|
$minaCode = $params["minaCode"];
|
|
|
- switch(trim($todo)){
|
|
|
+ switch (trim($todo)) {
|
|
|
case "all":
|
|
|
- $accountInfo=bizbase_traderAccountInfo($bizTrader);
|
|
|
+ $accountInfo = bizbase_traderAccountInfo($bizTrader);
|
|
|
$money = round(floatval($accountInfo["balance"]), 2);
|
|
|
break;
|
|
|
- case "part":
|
|
|
- $money = round(floatval($money), 2);
|
|
|
+ case "part":
|
|
|
+ $money = round(floatval($money), 2);
|
|
|
break;
|
|
|
- default:throw new GeneralException("","不支持的todo!");
|
|
|
+ default:throw new GeneralException("", "不支持的todo!");
|
|
|
}
|
|
|
- bizbase_accountWithdrawCheck($subSystem, $bizTrader, $money);
|
|
|
- require_once WEB_PHY_ROOT."/base/wxsrv.php";
|
|
|
+ bizbase_accountWithdrawCheck($subSystem, $bizTrader, $money);
|
|
|
+ require_once WEB_PHY_ROOT . "/base/wxsrv.php";
|
|
|
$resObj = bizwx_fetchMinaOpenidCore(SUBSYS_CAPITAL_MINA);
|
|
|
$wxmina_appid = $resObj["wxmina_appid"];
|
|
|
- $wxmina_openid = $resObj["openid"];
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":nowtime"]=time();
|
|
|
- $sqlParam[":biz_traderid"]=$bizTrader["id"];
|
|
|
- $sqlParam[":wxmina_appid"]=$wxmina_appid;
|
|
|
- $sqlParam[":wxmina_openid"]=$wxmina_openid;
|
|
|
- $sqlParam[":money"]=$money;
|
|
|
+ $wxmina_openid = $resObj["openid"];
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":nowtime"] = time();
|
|
|
+ $sqlParam[":biz_traderid"] = $bizTrader["id"];
|
|
|
+ $sqlParam[":wxmina_appid"] = $wxmina_appid;
|
|
|
+ $sqlParam[":wxmina_openid"] = $wxmina_openid;
|
|
|
+ $sqlParam[":money"] = $money;
|
|
|
$sqlParam[":prefix"] = "TXT" . date("YmdHis", time()) . "ID";
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" insert into biz_trader_account set createtime=:nowtime ";
|
|
|
- $sqlTemp.=" ,biz_traderid=:biz_traderid ";
|
|
|
- $sqlTemp.=" ,biz_roletype=0, biz_userid=:biz_traderid ";
|
|
|
- $sqlTemp.=" ,type=1, biz_catalog=5, money=:money ";
|
|
|
- $sqlTemp.=" ,wxmina_appid=:wxmina_appid, wxmina_openid=:wxmina_openid; ";
|
|
|
- $sqlTemp.=" update biz_trader_account set biz_idtag=concat(:prefix,id) where id=LAST_INSERT_ID(); ";
|
|
|
- $sqlTemp.=" select * from biz_trader_account where id=LAST_INSERT_ID(); ";
|
|
|
- $dataset=pdo_query3($sqlTemp,$sqlParam);
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " insert into biz_trader_account set createtime=:nowtime ";
|
|
|
+ $sqlTemp .= " ,biz_traderid=:biz_traderid ";
|
|
|
+ $sqlTemp .= " ,biz_roletype=0, biz_userid=:biz_traderid ";
|
|
|
+ $sqlTemp .= " ,type=1, biz_catalog=5, money=:money ";
|
|
|
+ $sqlTemp .= " ,wxmina_appid=:wxmina_appid, wxmina_openid=:wxmina_openid; ";
|
|
|
+ $sqlTemp .= " update biz_trader_account set biz_idtag=concat(:prefix,id) where id=LAST_INSERT_ID(); ";
|
|
|
+ $sqlTemp .= " select * from biz_trader_account where id=LAST_INSERT_ID(); ";
|
|
|
+ $dataset = pdo_query3($sqlTemp, $sqlParam);
|
|
|
$account = $dataset[count($dataset) - 1][0];
|
|
|
- $insertId=intval($account["id"]);
|
|
|
- $withdrawNO=trim($account["biz_idtag"]);
|
|
|
- try{
|
|
|
- $trueName = $trueName;
|
|
|
- $remark = "商家快来优钱包提现";
|
|
|
- include_once WEB_PHY_ROOT."/base/wxsrv.php";
|
|
|
+ $insertId = intval($account["id"]);
|
|
|
+ $withdrawNO = trim($account["biz_idtag"]);
|
|
|
+ try {
|
|
|
+ $trueName = $trueName;
|
|
|
+ $remark = "商家快来优钱包提现";
|
|
|
+ include_once WEB_PHY_ROOT . "/base/wxsrv.php";
|
|
|
$transResult = weixin_transfers($wxmina_appid, $wxmina_openid, $withdrawNO, $trueName, $money * 100, $remark);
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":id"]=$insertId;
|
|
|
- $sqlParam[":nowtime"]=time();
|
|
|
- $sqlParam[":remark"] = "[" . date("Y-m-d H:i:s", time()) . "] 提现成功 \n";
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" update biz_trader_account set updatetime=:nowtime ";
|
|
|
- $sqlTemp.=" ,`status`=1 ,remark=concat(:remark,ifnull(remark,'')) ";
|
|
|
- $sqlTemp.=" where id=:id;";
|
|
|
- $backdata= pdo_query($sqlTemp,$sqlParam);
|
|
|
- return $transResult;
|
|
|
- }catch(Throwable $ex){
|
|
|
- throw new GeneralException("", "提现异常" . $ex->getMessage());
|
|
|
- }
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":id"] = $insertId;
|
|
|
+ $sqlParam[":nowtime"] = time();
|
|
|
+ $sqlParam[":remark"] = "[" . date("Y-m-d H:i:s", time()) . "] 提现成功 \n";
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " update biz_trader_account set updatetime=:nowtime ";
|
|
|
+ $sqlTemp .= " ,`status`=1 ,remark=concat(:remark,ifnull(remark,'')) ";
|
|
|
+ $sqlTemp .= " where id=:id;";
|
|
|
+ $backdata = pdo_query($sqlTemp, $sqlParam);
|
|
|
+ return $transResult;
|
|
|
+ } catch (Throwable $ex) {
|
|
|
+ throw new GeneralException("", "提现异常" . $ex->getMessage());
|
|
|
+ }
|
|
|
});
|
|
|
return $result;
|
|
|
break;
|
|
|
- default: throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ default:throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
-function bizbase_accountWithdrawCheck($subSystem, $bizUser, $money){
|
|
|
- $minDate=1;
|
|
|
- $maxDate=31;
|
|
|
- $today=date("d",time());//提现日期
|
|
|
- if($today<$minDate || $today>$maxDate) throw new GeneralException("NotInWithdrawDateScope",array(
|
|
|
- "minDate" => $minDate, "maxDate" => $maxDate, "today" => date("Y-m-d", time()),
|
|
|
- ));
|
|
|
- $minMoney=0.3;//提现最小额
|
|
|
- if ($money < $minMoney) throw new GeneralException("WithdrawTooLittle", array(
|
|
|
- "minMoney" => $minMoney,
|
|
|
- ));
|
|
|
+function bizbase_accountWithdrawCheck($subSystem, $bizUser, $money)
|
|
|
+{
|
|
|
+ $minDate = 1;
|
|
|
+ $maxDate = 31;
|
|
|
+ $today = date("d", time()); //提现日期
|
|
|
+ if ($today < $minDate || $today > $maxDate) {
|
|
|
+ throw new GeneralException("NotInWithdrawDateScope", array(
|
|
|
+ "minDate" => $minDate, "maxDate" => $maxDate, "today" => date("Y-m-d", time()),
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ $minMoney = 0.3; //提现最小额
|
|
|
+ if ($money < $minMoney) {
|
|
|
+ throw new GeneralException("WithdrawTooLittle", array(
|
|
|
+ "minMoney" => $minMoney,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
-function bizbase_accountCatalogName($fromSubSystem, $type, $bizCatalog){
|
|
|
- $backdata=array();
|
|
|
+function bizbase_accountCatalogName($fromSubSystem, $type, $bizCatalog)
|
|
|
+{
|
|
|
+ $backdata = array();
|
|
|
$backdata["typeName"] = (intval($type) <= 0) ? "收入" : "支出";
|
|
|
- switch(intval($fromSubSystem)){
|
|
|
+ switch (intval($fromSubSystem)) {
|
|
|
case SUBSYS_LABOUR_MINA:
|
|
|
- if(intval($type) <= 0){//工人收入
|
|
|
- switch(intval($bizCatalog)){
|
|
|
+ if (intval($type) <= 0) { //工人收入
|
|
|
+ switch (intval($bizCatalog)) {
|
|
|
case 0:
|
|
|
- $backdata["bizCatalogName"]="工资收入";
|
|
|
+ $backdata["bizCatalogName"] = "工资收入";
|
|
|
break;
|
|
|
case 1:
|
|
|
- $backdata["bizCatalogName"]="佣金收入";
|
|
|
+ $backdata["bizCatalogName"] = "佣金收入";
|
|
|
break;
|
|
|
case 2:
|
|
|
- $backdata["bizCatalogName"]="支付活动报名";
|
|
|
+ $backdata["bizCatalogName"] = "支付活动报名";
|
|
|
break;
|
|
|
case 3:
|
|
|
- $backdata["bizCatalogName"]="微信充值";
|
|
|
+ $backdata["bizCatalogName"] = "微信充值";
|
|
|
break;
|
|
|
case 4:
|
|
|
- $backdata["bizCatalogName"]="支付报名押金";
|
|
|
+ $backdata["bizCatalogName"] = "支付报名押金";
|
|
|
break;
|
|
|
case 5:
|
|
|
- $backdata["bizCatalogName"]="报名押金退还";
|
|
|
+ $backdata["bizCatalogName"] = "报名押金退还";
|
|
|
break;
|
|
|
case 6:
|
|
|
- $backdata["bizCatalogName"]="违约罚金收入";
|
|
|
+ $backdata["bizCatalogName"] = "违约罚金收入";
|
|
|
break;
|
|
|
case 7:
|
|
|
- $backdata["bizCatalogName"]="解冻报名押金";
|
|
|
+ $backdata["bizCatalogName"] = "解冻报名押金";
|
|
|
break;
|
|
|
}
|
|
|
- }else{//工人支出
|
|
|
- switch(intval($bizCatalog)){
|
|
|
+ } else { //工人支出
|
|
|
+ switch (intval($bizCatalog)) {
|
|
|
case 0:
|
|
|
- $backdata["bizCatalogName"]="余额提现";
|
|
|
+ $backdata["bizCatalogName"] = "余额提现";
|
|
|
break;
|
|
|
case 1:
|
|
|
- $backdata["bizCatalogName"]="营销活动支出";
|
|
|
+ $backdata["bizCatalogName"] = "营销活动支出";
|
|
|
break;
|
|
|
case 2:
|
|
|
- $backdata["bizCatalogName"]="报名押金冻结";
|
|
|
+ $backdata["bizCatalogName"] = "报名押金冻结";
|
|
|
break;
|
|
|
case 3:
|
|
|
- $backdata["bizCatalogName"]="报名押金罚没";
|
|
|
+ $backdata["bizCatalogName"] = "报名押金罚没";
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case SUBSYS_CAPITAL_MINA:
|
|
|
- if(intval($type) <= 0){//商家收入
|
|
|
- switch(intval($bizCatalog)){
|
|
|
+ if (intval($type) <= 0) { //商家收入
|
|
|
+ switch (intval($bizCatalog)) {
|
|
|
case 0:
|
|
|
- $backdata["bizCatalogName"]="次数支付";
|
|
|
+ $backdata["bizCatalogName"] = "次数支付";
|
|
|
break;
|
|
|
case 1:
|
|
|
- $backdata["bizCatalogName"]="订单支付";
|
|
|
+ $backdata["bizCatalogName"] = "订单支付";
|
|
|
break;
|
|
|
case 2:
|
|
|
- $backdata["bizCatalogName"]="微信充值";
|
|
|
+ $backdata["bizCatalogName"] = "微信充值";
|
|
|
break;
|
|
|
case 3:
|
|
|
- $backdata["bizCatalogName"]="转帐收入";
|
|
|
+ $backdata["bizCatalogName"] = "转帐收入";
|
|
|
break;
|
|
|
case 4:
|
|
|
- $backdata["bizCatalogName"]="平台代支付工单";
|
|
|
+ $backdata["bizCatalogName"] = "平台代支付工单";
|
|
|
break;
|
|
|
case 5:
|
|
|
- $backdata["bizCatalogName"]="工单费用部分退还";
|
|
|
+ $backdata["bizCatalogName"] = "工单费用部分退还";
|
|
|
break;
|
|
|
case 6:
|
|
|
- $backdata["bizCatalogName"]="工单费用解冻";
|
|
|
+ $backdata["bizCatalogName"] = "工单费用解冻";
|
|
|
break;
|
|
|
case 7:
|
|
|
- $backdata["bizCatalogName"]="会员违约金收入";
|
|
|
+ $backdata["bizCatalogName"] = "会员违约金收入";
|
|
|
break;
|
|
|
}
|
|
|
- }else{//商家支出
|
|
|
- switch(intval($bizCatalog)){
|
|
|
+ } else { //商家支出
|
|
|
+ switch (intval($bizCatalog)) {
|
|
|
case 0:
|
|
|
- $backdata["bizCatalogName"]="次数支出";
|
|
|
+ $backdata["bizCatalogName"] = "次数支出";
|
|
|
break;
|
|
|
case 1:
|
|
|
- $backdata["bizCatalogName"]="订单平台分成支出";
|
|
|
+ $backdata["bizCatalogName"] = "订单平台分成支出";
|
|
|
break;
|
|
|
case 2:
|
|
|
- $backdata["bizCatalogName"]="订单佣金支出";
|
|
|
+ $backdata["bizCatalogName"] = "订单佣金支出";
|
|
|
break;
|
|
|
case 3:
|
|
|
- $backdata["bizCatalogName"]="订单工资支出";
|
|
|
+ $backdata["bizCatalogName"] = "订单工资支出";
|
|
|
break;
|
|
|
case 4:
|
|
|
- $backdata["bizCatalogName"]="转帐支出";
|
|
|
+ $backdata["bizCatalogName"] = "转帐支出";
|
|
|
break;
|
|
|
case 5:
|
|
|
- $backdata["bizCatalogName"]="提现支出";
|
|
|
+ $backdata["bizCatalogName"] = "提现支出";
|
|
|
break;
|
|
|
case 6:
|
|
|
- $backdata["bizCatalogName"]="订单费用支出";
|
|
|
+ $backdata["bizCatalogName"] = "订单费用支出";
|
|
|
break;
|
|
|
case 7:
|
|
|
- $backdata["bizCatalogName"]="平台代为支付订单费用";
|
|
|
+ $backdata["bizCatalogName"] = "平台代为支付订单费用";
|
|
|
break;
|
|
|
case 8:
|
|
|
- $backdata["bizCatalogName"]="工单费用冻结";
|
|
|
+ $backdata["bizCatalogName"] = "工单费用冻结";
|
|
|
break;
|
|
|
case 9:
|
|
|
- $backdata["bizCatalogName"]="工单违约罚金";
|
|
|
+ $backdata["bizCatalogName"] = "工单违约罚金";
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
- default: throw new GeneralException("","不支持的fromSubSystem!");
|
|
|
+ default:throw new GeneralException("", "不支持的fromSubSystem!");
|
|
|
}
|
|
|
return $backdata;
|
|
|
}
|
|
|
-function bizbase_accountEntityAboutQuery($fromSubSystem,$baseUser, $bizUser, $handleMode, $pageIndex, $pageSize,$ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL2_MINA) $bizTrader2 = $bizUser;
|
|
|
- $subSystem=intval($baseUser["subsystem"]);
|
|
|
- switch($handleMode){
|
|
|
- case "fetchallByTrader":
|
|
|
- $sqlParam=array();
|
|
|
+function bizbase_accountEntityAboutQuery($fromSubSystem, $baseUser, $bizUser, $handleMode, $pageIndex, $pageSize, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL2_MINA) {
|
|
|
+ $bizTrader2 = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ $subSystem = intval($baseUser["subsystem"]);
|
|
|
+ switch ($handleMode) {
|
|
|
+ case "fetchallByTrader":
|
|
|
+ $sqlParam = array();
|
|
|
$query = isset($ajaxdata["query"]) ? $ajaxdata["query"] : $GPC["query"];
|
|
|
- if (empty($query) && !is_array($query)){//验证一下query信息集
|
|
|
- $query=" and 1=1 ";
|
|
|
- }else{
|
|
|
- $queryNew=" and 1=1 ";
|
|
|
- foreach($query as $fdName=>$fdValue){
|
|
|
- if(empty($fdName) || empty($fdValue)) continue;
|
|
|
- switch($fdName){
|
|
|
+ if (empty($query) && !is_array($query)) { //验证一下query信息集
|
|
|
+ $query = " and 1=1 ";
|
|
|
+ } else {
|
|
|
+ $queryNew = " and 1=1 ";
|
|
|
+ foreach ($query as $fdName => $fdValue) {
|
|
|
+ if (empty($fdName) || empty($fdValue)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($fdName) {
|
|
|
case "catalog":
|
|
|
- switch(intval($fdValue)) {
|
|
|
+ switch (intval($fdValue)) {
|
|
|
case 1:
|
|
|
- if(!empty($bizTrader)){//专款专户
|
|
|
- $query.=" and bta.biz_roletype=0 ";
|
|
|
+ if (!empty($bizTrader)) { //专款专户
|
|
|
+ $query .= " and bta.biz_roletype=0 ";
|
|
|
}
|
|
|
break;
|
|
|
case 2:
|
|
|
- if(!empty($bizTrader)){//专款专户
|
|
|
- $query.=" and bta.biz_roletype=1 ";
|
|
|
+ if (!empty($bizTrader)) { //专款专户
|
|
|
+ $query .= " and bta.biz_roletype=1 ";
|
|
|
}
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
case "type":
|
|
|
- $queryNew .= " and bta.type=" . (intval($fdValue) - 1) . " ";
|
|
|
- break;
|
|
|
- case "bizCatalog":
|
|
|
- $queryNew .= " and bta.biz_catalog=" . (intval($fdValue) - 1) . " ";
|
|
|
- break;
|
|
|
- case "traderId":
|
|
|
- $queryNew .= " and bta.biz_traderid=".intval($fdValue)." ";
|
|
|
- break;
|
|
|
- case "companyName":
|
|
|
+ $queryNew .= " and bta.type=" . (intval($fdValue) - 1) . " ";
|
|
|
+ break;
|
|
|
+ case "bizCatalog":
|
|
|
+ $queryNew .= " and bta.biz_catalog=" . (intval($fdValue) - 1) . " ";
|
|
|
+ break;
|
|
|
+ case "traderId":
|
|
|
+ $queryNew .= " and bta.biz_traderid=" . intval($fdValue) . " ";
|
|
|
+ break;
|
|
|
+ case "companyName":
|
|
|
$paramName = ":qy_companyName";
|
|
|
- $queryNew .=" and (bt.company_name like concat('%',{$paramName},'%') ) ";
|
|
|
+ $queryNew .= " and (bt.company_name like concat('%',{$paramName},'%') ) ";
|
|
|
$sqlParam[$paramName] = $fdValue;
|
|
|
- break;
|
|
|
- case "occurdate":
|
|
|
- $yestoday=strtotime("-1 day",strtotime(date("Y-m-d 23:59:59", strtotime($fdValue))));
|
|
|
- $tomorrow=strtotime("+1 day",strtotime(date("Y-m-d 00:00:00", strtotime($fdValue))));
|
|
|
+ break;
|
|
|
+ case "occurdate":
|
|
|
+ $yestoday = strtotime("-1 day", strtotime(date("Y-m-d 23:59:59", strtotime($fdValue))));
|
|
|
+ $tomorrow = strtotime("+1 day", strtotime(date("Y-m-d 00:00:00", strtotime($fdValue))));
|
|
|
$queryNew .= " and bta.createtime>$yestoday and bta.createtime<$tomorrow ";
|
|
|
- break;
|
|
|
- }
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- $query=$queryNew;
|
|
|
- }
|
|
|
- if(!empty($bizTrader)){//专款专户
|
|
|
- $query.=" and bta.biz_traderid=".intval($bizTrader["id"])." ";
|
|
|
+ $query = $queryNew;
|
|
|
+ }
|
|
|
+ if (!empty($bizTrader)) { //专款专户
|
|
|
+ $query .= " and bta.biz_traderid=" . intval($bizTrader["id"]) . " ";
|
|
|
}
|
|
|
- //排序处理
|
|
|
+ //排序处理
|
|
|
$orderby = isset($ajaxdata["orderby"]) ? $ajaxdata["orderby"] : $GPC["orderby"];
|
|
|
- switch(intval($orderby)){
|
|
|
+ switch (intval($orderby)) {
|
|
|
case 1:
|
|
|
- $orderby=" order by bta.money desc ";
|
|
|
- break;
|
|
|
- default://创建时间倒序
|
|
|
- $orderby=" order by bta.id desc ";
|
|
|
+ $orderby = " order by bta.money desc ";
|
|
|
+ break;
|
|
|
+ default: //创建时间倒序
|
|
|
+ $orderby = " order by bta.id desc ";
|
|
|
break;
|
|
|
}
|
|
|
//构建sql串
|
|
|
- $sqlBody="";
|
|
|
- $sqlBody.=" from biz_trader_account bta ";
|
|
|
- $sqlBody.=" left join biz_trader bt on bt.id=bta.biz_traderid ";
|
|
|
- $sqlBody.=" left join base_user bu on bu.id=bt.base_userid ";
|
|
|
- $sqlBody.=" left join biz_trader2 bt2 on bta.biz_roletype=1 and bt2.id=bta.biz_userid ";
|
|
|
- $sqlBody.=" left join base_user bu2 on bu2.id=bt2.base_userid ";
|
|
|
- $sqlBody.=" where 1=1 and bta.deleted=0 and bta.`status`=1 and bta.money<>0 ".$query;
|
|
|
+ $sqlBody = "";
|
|
|
+ $sqlBody .= " from biz_trader_account bta ";
|
|
|
+ $sqlBody .= " left join biz_trader bt on bt.id=bta.biz_traderid ";
|
|
|
+ $sqlBody .= " left join base_user bu on bu.id=bt.base_userid ";
|
|
|
+ $sqlBody .= " left join biz_trader2 bt2 on bta.biz_roletype=1 and bt2.id=bta.biz_userid ";
|
|
|
+ $sqlBody .= " left join base_user bu2 on bu2.id=bt2.base_userid ";
|
|
|
+ $sqlBody .= " where 1=1 and bta.deleted=0 and bta.`status`=1 and bta.money<>0 " . $query;
|
|
|
//查询sql及统计sql
|
|
|
- $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
- $sqlFetch =" select bta.* ";
|
|
|
- $sqlFetch.=" ,bt.company_name as bt_company_name,bu.mobile as bu_mobile";
|
|
|
- $sqlFetch.=" ,bt2.true_name as bt2_true_name,bu2.mobile as bu2_mobile";
|
|
|
- $sqlFetch.=" {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
+ $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
+ $sqlFetch = " select bta.* ";
|
|
|
+ $sqlFetch .= " ,bt.company_name as bt_company_name,bu.mobile as bu_mobile";
|
|
|
+ $sqlFetch .= " ,bt2.true_name as bt2_true_name,bu2.mobile as bu2_mobile";
|
|
|
+ $sqlFetch .= " {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
$pageData = pdo_fetchall($sqlFetch, $sqlParam);
|
|
|
//联合查询下,列项应该不算太多,可手工转换/映射!!或者以占主体的实体为主进行转换/映射;
|
|
|
- foreach($pageData as &$data){//数据转换/映射
|
|
|
- $accountCatalogInfo=bizbase_accountCatalogName($subSystem,$data["type"],$data["biz_catalog"]);
|
|
|
- foreach ($accountCatalogInfo as $key => $value) $data["".$key] = $value;
|
|
|
+ foreach ($pageData as &$data) { //数据转换/映射
|
|
|
+ $accountCatalogInfo = bizbase_accountCatalogName($subSystem, $data["type"], $data["biz_catalog"]);
|
|
|
+ foreach ($accountCatalogInfo as $key => $value) {
|
|
|
+ $data["" . $key] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
$data["occurdatetime"] = date("Y-m-d H:i:s", $data["createtime"]);
|
|
|
$data["remark"] = trim(explode("\n", $data["remark"])[0]);
|
|
|
}
|
|
|
- $sqlSummary=" select count(*) as count,sum(money) as moneytotal ".$sqlBody.";";
|
|
|
- $sumData=pdo_fetch($sqlSummary,$sqlParam);
|
|
|
+ $sqlSummary = " select count(*) as count,sum(money) as moneytotal " . $sqlBody . ";";
|
|
|
+ $sumData = pdo_fetch($sqlSummary, $sqlParam);
|
|
|
return array(
|
|
|
"pageData" => $pageData,
|
|
|
"count" => intval($sumData["count"]),
|
|
|
"moneytotal" => round(floatval($sumData["moneytotal"]), 2),
|
|
|
- );
|
|
|
- break;
|
|
|
- case "fetchallByWorker":
|
|
|
- $sqlParam=array();
|
|
|
+ );
|
|
|
+ break;
|
|
|
+ case "fetchallByWorker":
|
|
|
+ $sqlParam = array();
|
|
|
$query = isset($ajaxdata["query"]) ? $ajaxdata["query"] : $GPC["query"];
|
|
|
- if (empty($query) && !is_array($query)){//验证一下query信息集
|
|
|
- $query=" and 1=1 ";
|
|
|
- }else{
|
|
|
- $queryNew=" and 1=1 ";
|
|
|
- foreach($query as $fdName=>$fdValue){
|
|
|
- if(empty($fdName) || empty($fdValue)) continue;
|
|
|
- switch($fdName){
|
|
|
+ if (empty($query) && !is_array($query)) { //验证一下query信息集
|
|
|
+ $query = " and 1=1 ";
|
|
|
+ } else {
|
|
|
+ $queryNew = " and 1=1 ";
|
|
|
+ foreach ($query as $fdName => $fdValue) {
|
|
|
+ if (empty($fdName) || empty($fdValue)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($fdName) {
|
|
|
case "type":
|
|
|
- $queryNew .= " and bwa.type=" . (intval($fdValue) - 1) . " ";
|
|
|
- break;
|
|
|
- case "bizCatalog":
|
|
|
- $queryNew .= " and bwa.biz_catalog=" . (intval($fdValue) - 1) . " ";
|
|
|
- break;
|
|
|
- case "workerId":
|
|
|
- $queryNew .= " and bwa.biz_workerid=".intval($fdValue)." ";
|
|
|
- break;
|
|
|
- case "memberName":
|
|
|
+ $queryNew .= " and bwa.type=" . (intval($fdValue) - 1) . " ";
|
|
|
+ break;
|
|
|
+ case "bizCatalog":
|
|
|
+ $queryNew .= " and bwa.biz_catalog=" . (intval($fdValue) - 1) . " ";
|
|
|
+ break;
|
|
|
+ case "workerId":
|
|
|
+ $queryNew .= " and bwa.biz_workerid=" . intval($fdValue) . " ";
|
|
|
+ break;
|
|
|
+ case "memberName":
|
|
|
$paramName = ":qy_memberName";
|
|
|
- $queryNew .=" and (wk.true_name like concat('%',{$paramName},'%') ) ";
|
|
|
+ $queryNew .= " and (wk.true_name like concat('%',{$paramName},'%') ) ";
|
|
|
$sqlParam[$paramName] = $fdValue;
|
|
|
- break;
|
|
|
- case "occurdate":
|
|
|
- $yestoday=strtotime("-1 day",strtotime(date("Y-m-d 23:59:59", strtotime($fdValue))));
|
|
|
- $tomorrow=strtotime("+1 day",strtotime(date("Y-m-d 00:00:00", strtotime($fdValue))));
|
|
|
+ break;
|
|
|
+ case "occurdate":
|
|
|
+ $yestoday = strtotime("-1 day", strtotime(date("Y-m-d 23:59:59", strtotime($fdValue))));
|
|
|
+ $tomorrow = strtotime("+1 day", strtotime(date("Y-m-d 00:00:00", strtotime($fdValue))));
|
|
|
$queryNew .= " and bwa.createtime>$yestoday and bwa.createtime<$tomorrow ";
|
|
|
- break;
|
|
|
- }
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- $query=$queryNew;
|
|
|
- }
|
|
|
- if(!empty($bizWorker)){
|
|
|
- $query.=" and bwa.biz_workerid=".intval($bizWorker["id"])." ";
|
|
|
- }
|
|
|
+ $query = $queryNew;
|
|
|
+ }
|
|
|
+ if (!empty($bizWorker)) {
|
|
|
+ $query .= " and bwa.biz_workerid=" . intval($bizWorker["id"]) . " ";
|
|
|
+ }
|
|
|
$orderby = isset($ajaxdata["orderby"]) ? $ajaxdata["orderby"] : $GPC["orderby"];
|
|
|
- switch(intval($orderby)){
|
|
|
+ switch (intval($orderby)) {
|
|
|
case 1:
|
|
|
- $orderby=" order by bwa.money desc ";
|
|
|
- break;
|
|
|
- default://创建时间倒序
|
|
|
- $orderby=" order by bwa.id desc ";
|
|
|
+ $orderby = " order by bwa.money desc ";
|
|
|
+ break;
|
|
|
+ default: //创建时间倒序
|
|
|
+ $orderby = " order by bwa.id desc ";
|
|
|
break;
|
|
|
}
|
|
|
//构建sql串
|
|
|
- $sqlBody="";
|
|
|
- $sqlBody.=" from biz_worker_account bwa ";
|
|
|
- $sqlBody.=" left join biz_worker wk on wk.id=bwa.biz_workerid ";
|
|
|
- $sqlBody.=" left join base_user bu on bu.id=wk.base_userid ";
|
|
|
- $sqlBody.=" where 1=1 and bwa.deleted=0 and bwa.`status`=1 and bwa.money<>0 ".$query;
|
|
|
+ $sqlBody = "";
|
|
|
+ $sqlBody .= " from biz_worker_account bwa ";
|
|
|
+ $sqlBody .= " left join biz_worker wk on wk.id=bwa.biz_workerid ";
|
|
|
+ $sqlBody .= " left join base_user bu on bu.id=wk.base_userid ";
|
|
|
+ $sqlBody .= " where 1=1 and bwa.deleted=0 and bwa.`status`=1 and bwa.money<>0 " . $query;
|
|
|
//查询sql及统计sql
|
|
|
- $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
- $sqlFetch =" select bwa.* ";
|
|
|
- $sqlFetch.=" ,wk.true_name as wk_true_name,bu.mobile as bu_mobile";
|
|
|
- $sqlFetch.=" {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
- $pageData = pdo_fetchall($sqlFetch, $sqlParam);
|
|
|
- foreach($pageData as &$data){ //数据转换/映射
|
|
|
- $accountCatalogInfo=bizbase_accountCatalogName($subSystem,$data["type"],$data["biz_catalog"]);
|
|
|
- foreach ($accountCatalogInfo as $key => $value) $data["".$key] = $value;
|
|
|
+ $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
+ $sqlFetch = " select bwa.* ";
|
|
|
+ $sqlFetch .= " ,wk.true_name as wk_true_name,bu.mobile as bu_mobile";
|
|
|
+ $sqlFetch .= " {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
+ $pageData = pdo_fetchall($sqlFetch, $sqlParam);
|
|
|
+ foreach ($pageData as &$data) { //数据转换/映射
|
|
|
+ $accountCatalogInfo = bizbase_accountCatalogName($subSystem, $data["type"], $data["biz_catalog"]);
|
|
|
+ foreach ($accountCatalogInfo as $key => $value) {
|
|
|
+ $data["" . $key] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
$data["occurdatetime"] = date("Y-m-d H:i:s", $data["createtime"]);
|
|
|
$data["remark"] = trim(explode("\n", $data["remark"])[0]);
|
|
|
}
|
|
|
- $sqlSummary=" select count(*) as count,sum(money) as moneytotal ".$sqlBody.";";
|
|
|
- $sumData=pdo_fetch($sqlSummary,$sqlParam);
|
|
|
+ $sqlSummary = " select count(*) as count,sum(money) as moneytotal " . $sqlBody . ";";
|
|
|
+ $sumData = pdo_fetch($sqlSummary, $sqlParam);
|
|
|
return array(
|
|
|
"pageData" => $pageData,
|
|
|
"count" => intval($sumData["count"]),
|
|
|
"moneytotal" => round(floatval($sumData["moneytotal"]), 2),
|
|
|
- );
|
|
|
- break;
|
|
|
+ );
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**********************通知公告信息相关逻辑**************************************/
|
|
|
-function bizbase_noticeEntityHandle($fromSubSystem, $baseUser, $bizUser,$handleMode, $ajaxdata, $GPC){
|
|
|
- switch($handleMode){
|
|
|
+function bizbase_noticeEntityHandle($fromSubSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ switch ($handleMode) {
|
|
|
case "fetch":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- if (empty($bizId)) throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
- $backdata = pdo_fetch("select * from biz_pubic_notice where id=" . intval($bizId));
|
|
|
- if(empty($backdata)) throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
- if (intval($backdata["deleted"]) != 0)
|
|
|
+ if (empty($bizId)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ $backdata = pdo_fetch("select * from biz_pubic_notice where id=" . intval($bizId));
|
|
|
+ if (empty($backdata)) {
|
|
|
+ throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($backdata["deleted"]) != 0) {
|
|
|
throw new GeneralException("", "此记录已删除了,请核查后再处理!");
|
|
|
- //数据转换 //属性映射
|
|
|
+ }
|
|
|
+
|
|
|
+ //数据转换 //属性映射
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
+ break;
|
|
|
case "delete":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- if (empty($bizId)) throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
- $backdata = pdo_fetch("select * from biz_pubic_notice where id=" . intval($bizId));
|
|
|
- if(empty($backdata)) throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
- if (intval($backdata["deleted"]) != 0)
|
|
|
+ if (empty($bizId)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ $backdata = pdo_fetch("select * from biz_pubic_notice where id=" . intval($bizId));
|
|
|
+ if (empty($backdata)) {
|
|
|
+ throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($backdata["deleted"]) != 0) {
|
|
|
throw new GeneralException("", "此记录已删除了,请核查后再处理!");
|
|
|
+ }
|
|
|
+
|
|
|
$reason = isset($ajaxdata["reason"]) ? $ajaxdata["reason"] : $GPC["reason"];
|
|
|
- $backdata=pdo_query("update biz_pubic_notice set updatetime=:nowtime
|
|
|
- ,`deleted`=1,remark=concat(:remark,ifnull(remark,'')) where id=:id",array(
|
|
|
- ":nowtime"=>time(),
|
|
|
- ":id"=>intval($bizId),
|
|
|
- ":remark"=>"[".date("Y-m-d H:i:s")."] 删除 $reason ",
|
|
|
- ));
|
|
|
+ $backdata = pdo_query("update biz_pubic_notice set updatetime=:nowtime
|
|
|
+ ,`deleted`=1,remark=concat(:remark,ifnull(remark,'')) where id=:id", array(
|
|
|
+ ":nowtime" => time(),
|
|
|
+ ":id" => intval($bizId),
|
|
|
+ ":remark" => "[" . date("Y-m-d H:i:s") . "] 删除 $reason ",
|
|
|
+ ));
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "upsert":
|
|
|
+ break;
|
|
|
+ case "upsert":
|
|
|
$bizData = isset($ajaxdata["bizData"]) ? $ajaxdata["bizData"] : $GPC["bizData"];
|
|
|
- if (empty($bizData)) throw new GeneralException("", "没有传递必要的bizData参数");
|
|
|
- $id = intval($bizData["id"]);
|
|
|
- $catalog = intval($bizData["catalog"]);
|
|
|
- $title = trim($bizData["title"]);
|
|
|
+ if (empty($bizData)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的bizData参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ $id = intval($bizData["id"]);
|
|
|
+ $catalog = intval($bizData["catalog"]);
|
|
|
+ $title = trim($bizData["title"]);
|
|
|
$content = trim($bizData["content"]);
|
|
|
- //-----------------------------------
|
|
|
- $saveData=array();
|
|
|
- $saveData["catalog"]=$catalog;
|
|
|
- $saveData["title"]=trim($title);
|
|
|
- $saveData["content"]=trim($content);
|
|
|
- if(mb_strlen(trim($saveData["content"]))<1) throw new GeneralException("","内容不能为空!");
|
|
|
+ //-----------------------------------
|
|
|
+ $saveData = array();
|
|
|
+ $saveData["catalog"] = $catalog;
|
|
|
+ $saveData["title"] = trim($title);
|
|
|
+ $saveData["content"] = trim($content);
|
|
|
+ if (mb_strlen(trim($saveData["content"])) < 1) {
|
|
|
+ throw new GeneralException("", "内容不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
if ($id > 0) {
|
|
|
$oldData = pdo_fetch("select * from biz_pubic_notice where id=" . intval($id));
|
|
|
- if (empty($oldData)) throw new GeneralException("", "此id对应的记录不存在,请核查bizId是否正确!");
|
|
|
- $saveData["updatetime"]=time();
|
|
|
- $saveData["updateuserid"]=intval($baseUser["id"]);
|
|
|
- $backdata = pdo_update("biz_pubic_notice", $saveData,array("id"=>$id));
|
|
|
+ if (empty($oldData)) {
|
|
|
+ throw new GeneralException("", "此id对应的记录不存在,请核查bizId是否正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ $saveData["updatetime"] = time();
|
|
|
+ $saveData["updateuserid"] = intval($baseUser["id"]);
|
|
|
+ $backdata = pdo_update("biz_pubic_notice", $saveData, array("id" => $id));
|
|
|
return $backdata;
|
|
|
- }else{
|
|
|
- $saveData["createtime"]=time();
|
|
|
- $saveData["createuserid"]=intval($baseUser["id"]);
|
|
|
+ } else {
|
|
|
+ $saveData["createtime"] = time();
|
|
|
+ $saveData["createuserid"] = intval($baseUser["id"]);
|
|
|
$backdata = pdo_insert("biz_pubic_notice", $saveData);
|
|
|
return $backdata;
|
|
|
- }
|
|
|
- break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
-function bizbase_noticeAboutQuery($fromSubSystem,$baseUser,$bizUser,$handleMode,$pageIndex,$pageSize,$ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL2_MINA) $bizTrader2 = $bizUser;
|
|
|
- switch($handleMode){
|
|
|
- case "fetchall":
|
|
|
- $sqlParam=array();
|
|
|
+function bizbase_noticeAboutQuery($fromSubSystem, $baseUser, $bizUser, $handleMode, $pageIndex, $pageSize, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL2_MINA) {
|
|
|
+ $bizTrader2 = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($handleMode) {
|
|
|
+ case "fetchall":
|
|
|
+ $sqlParam = array();
|
|
|
//查询处理
|
|
|
$query = isset($ajaxdata["query"]) ? $ajaxdata["query"] : $GPC["query"];
|
|
|
- if (empty($query) && !is_array($query)){//验证一下query信息集
|
|
|
- $query=" and 1=1 ";
|
|
|
- }else{
|
|
|
- $queryNew=" and 1=1 ";
|
|
|
- foreach($query as $fdName=>$fdValue){
|
|
|
- if(empty($fdName) || empty($fdValue)) continue;
|
|
|
- switch($fdName){
|
|
|
- case "catalog":
|
|
|
- $queryNew .=" and bpn.catalog=".(intval($fdValue)-1)." ";
|
|
|
- break;
|
|
|
- case "keywords":
|
|
|
+ if (empty($query) && !is_array($query)) { //验证一下query信息集
|
|
|
+ $query = " and 1=1 ";
|
|
|
+ } else {
|
|
|
+ $queryNew = " and 1=1 ";
|
|
|
+ foreach ($query as $fdName => $fdValue) {
|
|
|
+ if (empty($fdName) || empty($fdValue)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($fdName) {
|
|
|
+ case "catalog":
|
|
|
+ $queryNew .= " and bpn.catalog=" . (intval($fdValue) - 1) . " ";
|
|
|
+ break;
|
|
|
+ case "keywords":
|
|
|
$paramName = ":qy_keywords";
|
|
|
- $queryNew .=" and (bpn.title like concat('%',{$paramName},'%') or bpn.content like concat('%',{$paramName},'%')) ";
|
|
|
+ $queryNew .= " and (bpn.title like concat('%',{$paramName},'%') or bpn.content like concat('%',{$paramName},'%')) ";
|
|
|
$sqlParam[$paramName] = $fdValue;
|
|
|
- break;
|
|
|
- }
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- $query=$queryNew;
|
|
|
- }
|
|
|
- //排序处理
|
|
|
+ $query = $queryNew;
|
|
|
+ }
|
|
|
+ //排序处理
|
|
|
$orderby = isset($ajaxdata["orderby"]) ? $ajaxdata["orderby"] : $GPC["orderby"];
|
|
|
- switch(intval($orderby)){
|
|
|
- default://创建时间倒序
|
|
|
- $orderby=" order by bpn.id desc ";
|
|
|
+ switch (intval($orderby)) {
|
|
|
+ default: //创建时间倒序
|
|
|
+ $orderby = " order by bpn.id desc ";
|
|
|
break;
|
|
|
}
|
|
|
//构建sql串
|
|
|
- $sqlBody="";
|
|
|
- $sqlBody.=" from biz_pubic_notice bpn ";
|
|
|
- $sqlBody.=" left join base_user buc on buc.id=bpn.createuserid ";
|
|
|
- $sqlBody.=" left join base_user buu on buu.id=bpn.updateuserid ";
|
|
|
- $sqlBody.=" where bpn.`deleted`=0 ".$query;
|
|
|
+ $sqlBody = "";
|
|
|
+ $sqlBody .= " from biz_pubic_notice bpn ";
|
|
|
+ $sqlBody .= " left join base_user buc on buc.id=bpn.createuserid ";
|
|
|
+ $sqlBody .= " left join base_user buu on buu.id=bpn.updateuserid ";
|
|
|
+ $sqlBody .= " where bpn.`deleted`=0 " . $query;
|
|
|
//查询sql及统计sql
|
|
|
- $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
- $sqlFetch =" select bpn.*,buc.login_name as buc_login_name,buu.login_name as buu_login_name ";
|
|
|
- $sqlFetch.=" {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
+ $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
+ $sqlFetch = " select bpn.*,buc.login_name as buc_login_name,buu.login_name as buu_login_name ";
|
|
|
+ $sqlFetch .= " {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
$pageData = pdo_fetchall($sqlFetch, $sqlParam);
|
|
|
//联合查询下,列项应该不算太多,可手工转换/映射!!或者以占主体的实体为主进行转换/映射;
|
|
|
- foreach($pageData as &$data){//数据转换/映射
|
|
|
- $data["pasttimeTips"]=bizbase_pasttimeTips($data["createtime"]);
|
|
|
- $data["createtime"]=date("Y-m-d H:i:s",$data["createtime"]);
|
|
|
- if(!empty($bizTrader)){
|
|
|
- $biz_usertype=1;
|
|
|
- $biz_userid=$bizTrader["id"];
|
|
|
- }
|
|
|
- if(!empty($bizWorker)){
|
|
|
- $biz_usertype=2;
|
|
|
- $biz_userid=$bizWorker["id"];
|
|
|
- }
|
|
|
- if(!empty($biz_userid)){
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" set @handle_id=0; ";
|
|
|
- $sqlTemp.=" select @handle_id:=id from biz_basetrace bbt";
|
|
|
- $sqlTemp.=" where bbt.deleted=0 and bbt.biz_catalog=1 and bbt.biz_id=:noticeid and bbt.biz_usertype=:biz_usertype and bbt.biz_userid=:biz_userid; ";
|
|
|
- $sqlTemp.=" insert into biz_basetrace(`biz_catalog`, biz_id, biz_usertype, biz_userid, count)";
|
|
|
- $sqlTemp.=" select 1,:noticeid,:biz_usertype,:biz_userid, 1";
|
|
|
- $sqlTemp.=" from dual where ifnull(@handle_id,0)=0 ;";
|
|
|
+ foreach ($pageData as &$data) { //数据转换/映射
|
|
|
+ $data["pasttimeTips"] = bizbase_pasttimeTips($data["createtime"]);
|
|
|
+ $data["createtime"] = date("Y-m-d H:i:s", $data["createtime"]);
|
|
|
+ if (!empty($bizTrader)) {
|
|
|
+ $biz_usertype = 1;
|
|
|
+ $biz_userid = $bizTrader["id"];
|
|
|
+ }
|
|
|
+ if (!empty($bizWorker)) {
|
|
|
+ $biz_usertype = 2;
|
|
|
+ $biz_userid = $bizWorker["id"];
|
|
|
+ }
|
|
|
+ if (!empty($biz_userid)) {
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " set @handle_id=0; ";
|
|
|
+ $sqlTemp .= " select @handle_id:=id from biz_basetrace bbt";
|
|
|
+ $sqlTemp .= " where bbt.deleted=0 and bbt.biz_catalog=1 and bbt.biz_id=:noticeid and bbt.biz_usertype=:biz_usertype and bbt.biz_userid=:biz_userid; ";
|
|
|
+ $sqlTemp .= " insert into biz_basetrace(`biz_catalog`, biz_id, biz_usertype, biz_userid, count)";
|
|
|
+ $sqlTemp .= " select 1,:noticeid,:biz_usertype,:biz_userid, 1";
|
|
|
+ $sqlTemp .= " from dual where ifnull(@handle_id,0)=0 ;";
|
|
|
$backdata = pdo_query3($sqlTemp, array(
|
|
|
- ":noticeid"=>$data["id"],
|
|
|
- ":biz_usertype"=>$biz_usertype,
|
|
|
- ":biz_userid"=>$biz_userid,
|
|
|
- ));
|
|
|
+ ":noticeid" => $data["id"],
|
|
|
+ ":biz_usertype" => $biz_usertype,
|
|
|
+ ":biz_userid" => $biz_userid,
|
|
|
+ ));
|
|
|
}
|
|
|
}
|
|
|
- $sqlSummary=" select count(*) as count ".$sqlBody.";";
|
|
|
- $sumData=pdo_fetch($sqlSummary,$sqlParam);
|
|
|
+ $sqlSummary = " select count(*) as count " . $sqlBody . ";";
|
|
|
+ $sumData = pdo_fetch($sqlSummary, $sqlParam);
|
|
|
return array(
|
|
|
"pageData" => $pageData,
|
|
|
"count" => intval($sumData["count"]),
|
|
|
- );
|
|
|
- break;
|
|
|
+ );
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**********************评价信息相关逻辑**************************************/
|
|
|
-function bizbase_appraisalEntityHandle($subSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL2_MINA) $bizTrader2 = $bizUser;
|
|
|
- switch($handleMode){
|
|
|
+function bizbase_appraisalEntityHandle($subSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL2_MINA) {
|
|
|
+ $bizTrader2 = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($handleMode) {
|
|
|
case "fetch":
|
|
|
// $bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
// if (empty($bizId)) throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
- // $backdata = pdo_fetch("select * from biz_pubic_notice where id=" . intval($bizId));
|
|
|
- // if(empty($backdata)) throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
+ // $backdata = pdo_fetch("select * from biz_pubic_notice where id=" . intval($bizId));
|
|
|
+ // if(empty($backdata)) throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
// if (intval($backdata["deleted"]) != 0)
|
|
|
- // throw new GeneralException("", "此记录已删除了,请核查后再处理!");
|
|
|
+ // throw new GeneralException("", "此记录已删除了,请核查后再处理!");
|
|
|
// return $backdata;
|
|
|
- break;
|
|
|
+ break;
|
|
|
case "delete":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- if (empty($bizId)) throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
- $backdata = pdo_fetch("select * from biz_appraisal where id=" . intval($bizId));
|
|
|
- if(empty($backdata)) throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
- if (intval($backdata["deleted"]) != 0)
|
|
|
- throw new GeneralException("", "此记录已删除了,请核查后再处理!");
|
|
|
- $backdata = pdo_query("delete from biz_appraisal where id=" . intval($bizId));
|
|
|
+ if (empty($bizId)) {
|
|
|
+ throw new GeneralException("", "没有传递必要的bizId参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ $backdata = pdo_fetch("select * from biz_appraisal where id=" . intval($bizId));
|
|
|
+ if (empty($backdata)) {
|
|
|
+ throw new GeneralException("", "无此记录,请核查bizId是否正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($backdata["deleted"]) != 0) {
|
|
|
+ throw new GeneralException("", "此记录已删除了,请核查后再处理!");
|
|
|
+ }
|
|
|
+
|
|
|
+ $backdata = pdo_query("delete from biz_appraisal where id=" . intval($bizId));
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
-function bizbase_appraisalAboutQuery($subSystem, $baseUser, $bizUser,$handleMode,$pageIndex,$pageSize,$ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL2_MINA) $bizTrader2 = $bizUser;
|
|
|
- switch($handleMode){
|
|
|
- case "fetchall":
|
|
|
- $sqlParam=array();
|
|
|
+function bizbase_appraisalAboutQuery($subSystem, $baseUser, $bizUser, $handleMode, $pageIndex, $pageSize, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL2_MINA) {
|
|
|
+ $bizTrader2 = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($handleMode) {
|
|
|
+ case "fetchall":
|
|
|
+ $sqlParam = array();
|
|
|
$query = isset($ajaxdata["query"]) ? $ajaxdata["query"] : $GPC["query"];
|
|
|
- if (empty($query) && !is_array($query)){//验证一下query信息集
|
|
|
- $query=" and 1=1 ";
|
|
|
- }else{
|
|
|
- $queryNew=" and 1=1 ";
|
|
|
- foreach($query as $fdName=>$fdValue){
|
|
|
- if(empty($fdName) || empty($fdValue)) continue;
|
|
|
- switch($fdName){
|
|
|
- case "bizCatalog":
|
|
|
- $queryNew .=" and apa.biz_catalog=".(intval($fdValue)-1)." ";
|
|
|
- break;
|
|
|
- case "fromWorkerId":
|
|
|
- $queryNew .=" and (apa.biz_catalog=0 or apa.biz_catalog=1) ";
|
|
|
- $queryNew .=" and apa.fromerid=".intval($fdValue)." ";
|
|
|
- break;
|
|
|
- case "fromTraderId":
|
|
|
- $queryNew .=" and (apa.biz_catalog=2) ";
|
|
|
- $queryNew .=" and apa.fromerid=".intval($fdValue)." ";
|
|
|
- break;
|
|
|
- case "toWorkerId":
|
|
|
- $queryNew .=" and (apa.biz_catalog=2) ";
|
|
|
- $queryNew .=" and apa.toerid=".intval($fdValue)." ";
|
|
|
- break;
|
|
|
- case "toTraderId":
|
|
|
- $queryNew .=" and (apa.biz_catalog=1) ";
|
|
|
- $queryNew .=" and apa.toerid=".intval($fdValue)." ";
|
|
|
- break;
|
|
|
- case "activityId":
|
|
|
- $queryNew .=" and (apa.biz_catalog=0) ";
|
|
|
- $queryNew .=" and bmao.market_activityid=".intval($fdValue)." ";
|
|
|
- break;
|
|
|
- case "recuritId":
|
|
|
- $queryNew .=" and (apa.biz_catalog=1 or apa.biz_catalog=2) ";
|
|
|
- $queryNew .=" and tdwk.biz_recruitid=".intval($fdValue)." ";
|
|
|
- break;
|
|
|
- case "title":
|
|
|
+ if (empty($query) && !is_array($query)) { //验证一下query信息集
|
|
|
+ $query = " and 1=1 ";
|
|
|
+ } else {
|
|
|
+ $queryNew = " and 1=1 ";
|
|
|
+ foreach ($query as $fdName => $fdValue) {
|
|
|
+ if (empty($fdName) || empty($fdValue)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($fdName) {
|
|
|
+ case "bizCatalog":
|
|
|
+ $queryNew .= " and apa.biz_catalog=" . (intval($fdValue) - 1) . " ";
|
|
|
+ break;
|
|
|
+ case "fromWorkerId":
|
|
|
+ $queryNew .= " and (apa.biz_catalog=0 or apa.biz_catalog=1) ";
|
|
|
+ $queryNew .= " and apa.fromerid=" . intval($fdValue) . " ";
|
|
|
+ break;
|
|
|
+ case "fromTraderId":
|
|
|
+ $queryNew .= " and (apa.biz_catalog=2) ";
|
|
|
+ $queryNew .= " and apa.fromerid=" . intval($fdValue) . " ";
|
|
|
+ break;
|
|
|
+ case "toWorkerId":
|
|
|
+ $queryNew .= " and (apa.biz_catalog=2) ";
|
|
|
+ $queryNew .= " and apa.toerid=" . intval($fdValue) . " ";
|
|
|
+ break;
|
|
|
+ case "toTraderId":
|
|
|
+ $queryNew .= " and (apa.biz_catalog=1) ";
|
|
|
+ $queryNew .= " and apa.toerid=" . intval($fdValue) . " ";
|
|
|
+ break;
|
|
|
+ case "activityId":
|
|
|
+ $queryNew .= " and (apa.biz_catalog=0) ";
|
|
|
+ $queryNew .= " and bmao.market_activityid=" . intval($fdValue) . " ";
|
|
|
+ break;
|
|
|
+ case "recuritId":
|
|
|
+ $queryNew .= " and (apa.biz_catalog=1 or apa.biz_catalog=2) ";
|
|
|
+ $queryNew .= " and tdwk.biz_recruitid=" . intval($fdValue) . " ";
|
|
|
+ break;
|
|
|
+ case "title":
|
|
|
$paramName = ":qy_keywords";
|
|
|
- $queryNew .=" and (btr.title like concat('%',{$paramName},'%') or bma.title like concat('%',{$paramName},'%')) ";
|
|
|
+ $queryNew .= " and (btr.title like concat('%',{$paramName},'%') or bma.title like concat('%',{$paramName},'%')) ";
|
|
|
$sqlParam[$paramName] = $fdValue;
|
|
|
- break;
|
|
|
- case "memberName":
|
|
|
- $paramName = ":qy_memberName";
|
|
|
- $queryNew .=" and (fwk.true_name like concat('%',{$paramName},'%') or twk.true_name like concat('%',{$paramName},'%')) ";
|
|
|
+ break;
|
|
|
+ case "memberName":
|
|
|
+ $paramName = ":qy_memberName";
|
|
|
+ $queryNew .= " and (fwk.true_name like concat('%',{$paramName},'%') or twk.true_name like concat('%',{$paramName},'%')) ";
|
|
|
$sqlParam[$paramName] = $fdValue;
|
|
|
- break;
|
|
|
- case "companyName":
|
|
|
+ break;
|
|
|
+ case "companyName":
|
|
|
$paramName = ":qy_companyName";
|
|
|
- $queryNew .=" and (fbt.company_name like concat('%',{$paramName},'%') or tbt.company_name like concat('%',{$paramName},'%')) ";
|
|
|
+ $queryNew .= " and (fbt.company_name like concat('%',{$paramName},'%') or tbt.company_name like concat('%',{$paramName},'%')) ";
|
|
|
$sqlParam[$paramName] = $fdValue;
|
|
|
- break;
|
|
|
- }
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- $query=$queryNew;
|
|
|
- }
|
|
|
+ $query = $queryNew;
|
|
|
+ }
|
|
|
$orderby11 = isset($ajaxdata["orderby"]) ? $ajaxdata["orderby"] : $GPC["orderby"];
|
|
|
- switch(intval($orderby11)){
|
|
|
- default://创建时间倒序
|
|
|
- $orderby=" order by apa.id desc ";
|
|
|
+ switch (intval($orderby11)) {
|
|
|
+ default: //创建时间倒序
|
|
|
+ $orderby = " order by apa.id desc ";
|
|
|
break;
|
|
|
- }
|
|
|
+ }
|
|
|
$roleCatalog = isset($ajaxdata["roleCatalog"]) ? $ajaxdata["roleCatalog"] : $GPC["roleCatalog"];
|
|
|
- $sqlBodyExt="";
|
|
|
- $sqlFetchExt="";
|
|
|
- $sqlSummaryPre="";
|
|
|
- $sqlSummaryPost="";
|
|
|
- switch(intval($roleCatalog)){
|
|
|
- case 0://所有首页用 明细模式
|
|
|
- $sqlBodyExt=" group by apa.id ";
|
|
|
- $sqlFetchExt=" ,count(apa.id) as apa_total";
|
|
|
- $sqlSummaryPre=" from (select apa.id ";
|
|
|
- $sqlSummaryPost=" ) as temp ";
|
|
|
- switch(intval($orderby11)){
|
|
|
+ $sqlBodyExt = "";
|
|
|
+ $sqlFetchExt = "";
|
|
|
+ $sqlSummaryPre = "";
|
|
|
+ $sqlSummaryPost = "";
|
|
|
+ switch (intval($roleCatalog)) {
|
|
|
+ case 0: //所有首页用 明细模式
|
|
|
+ $sqlBodyExt = " group by apa.id ";
|
|
|
+ $sqlFetchExt = " ,count(apa.id) as apa_total";
|
|
|
+ $sqlSummaryPre = " from (select apa.id ";
|
|
|
+ $sqlSummaryPost = " ) as temp ";
|
|
|
+ switch (intval($orderby11)) {
|
|
|
default:
|
|
|
- $orderby=" order by apa.id desc ";
|
|
|
+ $orderby = " order by apa.id desc ";
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
- case 1://会员评价
|
|
|
- $query.=" and (apa.biz_catalog=0 or apa.biz_catalog=1) ";
|
|
|
- $sqlBodyExt=" group by apa.fromerid ";
|
|
|
- $sqlFetchExt=" ,count(apa.id) as apa_total";
|
|
|
- $sqlSummaryPre=" from (select apa.id ";
|
|
|
- $sqlSummaryPost=" ) as temp ";
|
|
|
- switch(intval($orderby11)){
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 1: //会员评价
|
|
|
+ $query .= " and (apa.biz_catalog=0 or apa.biz_catalog=1) ";
|
|
|
+ $sqlBodyExt = " group by apa.fromerid ";
|
|
|
+ $sqlFetchExt = " ,count(apa.id) as apa_total";
|
|
|
+ $sqlSummaryPre = " from (select apa.id ";
|
|
|
+ $sqlSummaryPost = " ) as temp ";
|
|
|
+ switch (intval($orderby11)) {
|
|
|
default:
|
|
|
- $orderby=" order by apa_total desc ";
|
|
|
+ $orderby = " order by apa_total desc ";
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
- case 2://商家评价
|
|
|
- $query.=" and (apa.biz_catalog=2) ";
|
|
|
- $sqlBodyExt=" group by apa.fromerid ";
|
|
|
- $sqlFetchExt=" ,count(apa.id) as apa_total";
|
|
|
- $sqlSummaryPre=" from (select apa.id ";
|
|
|
- $sqlSummaryPost=" ) as temp ";
|
|
|
- switch(intval($orderby11)){
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2: //商家评价
|
|
|
+ $query .= " and (apa.biz_catalog=2) ";
|
|
|
+ $sqlBodyExt = " group by apa.fromerid ";
|
|
|
+ $sqlFetchExt = " ,count(apa.id) as apa_total";
|
|
|
+ $sqlSummaryPre = " from (select apa.id ";
|
|
|
+ $sqlSummaryPost = " ) as temp ";
|
|
|
+ switch (intval($orderby11)) {
|
|
|
default:
|
|
|
- $orderby=" order by apa_total desc ";
|
|
|
+ $orderby = " order by apa_total desc ";
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
- case 3://会员被评价
|
|
|
- $query.=" and (apa.biz_catalog=2) ";
|
|
|
- $sqlBodyExt=" group by apa.toerid ";
|
|
|
- $sqlFetchExt=" ,count(apa.id) as apa_total,avg(apa.result_level) as apa_avg";
|
|
|
- $sqlSummaryPre=" from (select apa.id ";
|
|
|
- $sqlSummaryPost=" ) as temp ";
|
|
|
- switch(intval($orderby11)){
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3: //会员被评价
|
|
|
+ $query .= " and (apa.biz_catalog=2) ";
|
|
|
+ $sqlBodyExt = " group by apa.toerid ";
|
|
|
+ $sqlFetchExt = " ,count(apa.id) as apa_total,avg(apa.result_level) as apa_avg";
|
|
|
+ $sqlSummaryPre = " from (select apa.id ";
|
|
|
+ $sqlSummaryPost = " ) as temp ";
|
|
|
+ switch (intval($orderby11)) {
|
|
|
case 1:
|
|
|
- $orderby=" order by apa_total desc ";
|
|
|
+ $orderby = " order by apa_total desc ";
|
|
|
break;
|
|
|
case 2:
|
|
|
- $orderby=" order by apa_avg desc ";
|
|
|
- break;
|
|
|
+ $orderby = " order by apa_avg desc ";
|
|
|
+ break;
|
|
|
default:
|
|
|
- $orderby=" order by apa.id desc ";
|
|
|
+ $orderby = " order by apa.id desc ";
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
- case 4://商家被评价
|
|
|
- $query.=" and (apa.biz_catalog=1) ";
|
|
|
- $sqlBodyExt=" group by apa.toerid ";
|
|
|
- $sqlFetchExt=" ,count(apa.id) as apa_total,avg(apa.result_level) as apa_avg";
|
|
|
- $sqlSummaryPre=" from (select apa.id ";
|
|
|
- $sqlSummaryPost=" ) as temp ";
|
|
|
- switch(intval($orderby11)){
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4: //商家被评价
|
|
|
+ $query .= " and (apa.biz_catalog=1) ";
|
|
|
+ $sqlBodyExt = " group by apa.toerid ";
|
|
|
+ $sqlFetchExt = " ,count(apa.id) as apa_total,avg(apa.result_level) as apa_avg";
|
|
|
+ $sqlSummaryPre = " from (select apa.id ";
|
|
|
+ $sqlSummaryPost = " ) as temp ";
|
|
|
+ switch (intval($orderby11)) {
|
|
|
case 1:
|
|
|
- $orderby=" order by apa_total desc ";
|
|
|
+ $orderby = " order by apa_total desc ";
|
|
|
break;
|
|
|
case 2:
|
|
|
- $orderby=" order by apa_avg desc ";
|
|
|
- break;
|
|
|
+ $orderby = " order by apa_avg desc ";
|
|
|
+ break;
|
|
|
default:
|
|
|
- $orderby=" order by apa.id desc ";
|
|
|
+ $orderby = " order by apa.id desc ";
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
- case 5://活动评价
|
|
|
- $query.=" and (apa.biz_catalog=0) ";
|
|
|
- $sqlBodyExt=" group by bmao.market_activityid ";
|
|
|
- $sqlFetchExt=" ,count(apa.id) as apa_total,avg(apa.result_level) as apa_avg";
|
|
|
- $sqlSummaryPre=" from (select apa.id ";
|
|
|
- $sqlSummaryPost=" ) as temp ";
|
|
|
- switch(intval($orderby11)){
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 5: //活动评价
|
|
|
+ $query .= " and (apa.biz_catalog=0) ";
|
|
|
+ $sqlBodyExt = " group by bmao.market_activityid ";
|
|
|
+ $sqlFetchExt = " ,count(apa.id) as apa_total,avg(apa.result_level) as apa_avg";
|
|
|
+ $sqlSummaryPre = " from (select apa.id ";
|
|
|
+ $sqlSummaryPost = " ) as temp ";
|
|
|
+ switch (intval($orderby11)) {
|
|
|
default:
|
|
|
- $orderby=" order by apa_avg desc ";
|
|
|
+ $orderby = " order by apa_avg desc ";
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
- case 6://招聘评价
|
|
|
- $query.=" and (apa.biz_catalog=1 or apa.biz_catalog=2) ";
|
|
|
- $sqlBodyExt=" group by tdwk.biz_recruitid ";
|
|
|
- $sqlFetchExt=" ,count(apa.id) as apa_total,avg(apa.result_level) as apa_avg";
|
|
|
- $sqlSummaryPre=" from (select apa.id ";
|
|
|
- $sqlSummaryPost=" ) as temp ";
|
|
|
- switch(intval($orderby11)){
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 6: //招聘评价
|
|
|
+ $query .= " and (apa.biz_catalog=1 or apa.biz_catalog=2) ";
|
|
|
+ $sqlBodyExt = " group by tdwk.biz_recruitid ";
|
|
|
+ $sqlFetchExt = " ,count(apa.id) as apa_total,avg(apa.result_level) as apa_avg";
|
|
|
+ $sqlSummaryPre = " from (select apa.id ";
|
|
|
+ $sqlSummaryPost = " ) as temp ";
|
|
|
+ switch (intval($orderby11)) {
|
|
|
default:
|
|
|
- $orderby=" order by apa_avg desc ";
|
|
|
+ $orderby = " order by apa_avg desc ";
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- $sqlBody="";
|
|
|
- $sqlBody.=" from biz_appraisal apa ";
|
|
|
- $sqlBody.=" left join biz_worker fwk on fwk.id=apa.fromerid";
|
|
|
- $sqlBody.=" left join base_user fwkbu on fwkbu.id=fwk.base_userid";
|
|
|
- $sqlBody.=" left join biz_trader fbt on fbt.id=apa.fromerid";
|
|
|
- $sqlBody.=" left join base_user fbtbu on fbtbu.id=fbt.base_userid";
|
|
|
- $sqlBody.=" left join biz_worker twk on twk.id=apa.toerid";
|
|
|
- $sqlBody.=" left join base_user twkbu on twkbu.id=twk.base_userid";
|
|
|
- $sqlBody.=" left join biz_trader tbt on tbt.id=apa.toerid";
|
|
|
- $sqlBody.=" left join base_user tbtbu on tbtbu.id=tbt.base_userid";
|
|
|
- $sqlBody.=" left join biz_market_activity_order bmao on bmao.id=apa.biz_id and apa.biz_catalog=0";
|
|
|
- $sqlBody.=" left join biz_market_activity bma on bma.id=bmao.market_activityid";
|
|
|
- $sqlBody.=" left join biz_todowork tdwk on tdwk.id=apa.biz_id and (apa.biz_catalog=1 or apa.biz_catalog=2)";
|
|
|
- $sqlBody.=" left join biz_trader_recruit btr on btr.id=tdwk.biz_recruitid";
|
|
|
- $sqlBody.=" where apa.`deleted`=0 ".$query;
|
|
|
- $sqlBody.=$sqlBodyExt;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $sqlBody = "";
|
|
|
+ $sqlBody .= " from biz_appraisal apa ";
|
|
|
+ $sqlBody .= " left join biz_worker fwk on fwk.id=apa.fromerid";
|
|
|
+ $sqlBody .= " left join base_user fwkbu on fwkbu.id=fwk.base_userid";
|
|
|
+ $sqlBody .= " left join biz_trader fbt on fbt.id=apa.fromerid";
|
|
|
+ $sqlBody .= " left join base_user fbtbu on fbtbu.id=fbt.base_userid";
|
|
|
+ $sqlBody .= " left join biz_worker twk on twk.id=apa.toerid";
|
|
|
+ $sqlBody .= " left join base_user twkbu on twkbu.id=twk.base_userid";
|
|
|
+ $sqlBody .= " left join biz_trader tbt on tbt.id=apa.toerid";
|
|
|
+ $sqlBody .= " left join base_user tbtbu on tbtbu.id=tbt.base_userid";
|
|
|
+ $sqlBody .= " left join biz_market_activity_order bmao on bmao.id=apa.biz_id and apa.biz_catalog=0";
|
|
|
+ $sqlBody .= " left join biz_market_activity bma on bma.id=bmao.market_activityid";
|
|
|
+ $sqlBody .= " left join biz_todowork tdwk on tdwk.id=apa.biz_id and (apa.biz_catalog=1 or apa.biz_catalog=2)";
|
|
|
+ $sqlBody .= " left join biz_trader_recruit btr on btr.id=tdwk.biz_recruitid";
|
|
|
+ $sqlBody .= " where apa.`deleted`=0 " . $query;
|
|
|
+ $sqlBody .= $sqlBodyExt;
|
|
|
//查询sql及统计sql
|
|
|
- $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
- $sqlFetch =" select apa.* ";
|
|
|
- $sqlFetch.=" ,(case when fwk.true_name<>'' then fwk.true_name else fwk.nickname end) as fwk_truename,fwkbu.mobile as fwkbu_mobile ";
|
|
|
- $sqlFetch.=" ,(case when twk.true_name<>'' then twk.true_name else twk.nickname end) as twk_truename,twkbu.mobile as twkbu_mobile ";
|
|
|
- $sqlFetch.=" ,fbt.company_name as fbt_companyname,fbtbu.mobile as fbtbu_mobile ";
|
|
|
- $sqlFetch.=" ,tbt.company_name as tbt_companyname,tbtbu.mobile as tbtbu_mobile ";
|
|
|
- $sqlFetch.=" ,bmao.market_activityid, bma.title as bma_title ";
|
|
|
- $sqlFetch.=" ,tdwk.biz_recruitid, btr.title as btr_title ";
|
|
|
- $sqlFetch.=" ,ifnull(avg(apa.result_level),0) as avg_level ";
|
|
|
- $sqlFetch.=" ,count(apa.id) as apa_count ";
|
|
|
- $sqlFetch.=" {$sqlFetchExt} {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
- $pageData = pdo_fetchall($sqlFetch, $sqlParam);
|
|
|
- foreach($pageData as &$data){//数据转换/映射
|
|
|
+ $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
+ $sqlFetch = " select apa.* ";
|
|
|
+ $sqlFetch .= " ,(case when fwk.true_name<>'' then fwk.true_name else fwk.nickname end) as fwk_truename,fwkbu.mobile as fwkbu_mobile ";
|
|
|
+ $sqlFetch .= " ,(case when twk.true_name<>'' then twk.true_name else twk.nickname end) as twk_truename,twkbu.mobile as twkbu_mobile ";
|
|
|
+ //$sqlFetch .= " ,fbt.company_name as fbt_companyname,fbtbu.mobile as fbtbu_mobile ";
|
|
|
+ $sqlFetch .= " ,(case when fbt.company_name <>'' then fbt.company_name else fbt.nickname end) as fbt_companyname ";
|
|
|
+ $sqlFetch .= " ,fbtbu.mobile as fbtbu_mobile ";
|
|
|
+ $sqlFetch .= ",(case when tbt.company_name <>'' then tbt.company_name else tbt.nickname end) as tbt_companyname ";
|
|
|
+ //$sqlFetch .= " ,tbt.company_name as tbt_companyname,tbtbu.mobile as tbtbu_mobile ";
|
|
|
+ $sqlFetch .= " ,tbtbu.mobile as tbtbu_mobile ";
|
|
|
+ $sqlFetch .= " ,bmao.market_activityid, bma.title as bma_title ";
|
|
|
+ $sqlFetch .= " ,tdwk.biz_recruitid, btr.title as btr_title ";
|
|
|
+ $sqlFetch .= " ,ifnull(avg(apa.result_level),0) as avg_level ";
|
|
|
+ $sqlFetch .= " ,count(apa.id) as apa_count ";
|
|
|
+ $sqlFetch .= " {$sqlFetchExt} {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
+ $pageData = pdo_fetchall($sqlFetch, $sqlParam);
|
|
|
+ foreach ($pageData as &$data) { //数据转换/映射
|
|
|
unset($data["remark"]);
|
|
|
- $data["avg_level"]=round($data["avg_level"],1);
|
|
|
- $data["pasttimeTips"]=bizbase_pasttimeTips($data["createtime"]);
|
|
|
- $data["createtime"]=date("Y-m-d H:i:s",$data["createtime"]);
|
|
|
- $data["fromWorkerId"]=$data["fromerid"];
|
|
|
- $data["fromTraderId"]=$data["fromerid"];
|
|
|
- $data["toWorkerId"]=$data["toerid"];
|
|
|
- $data["toTraderId"]=$data["toerid"];
|
|
|
- $data["activityId"]=$data["market_activityid"];
|
|
|
- $data["recuritId"]=$data["biz_recruitid"];
|
|
|
- switch(intval($data["biz_catalog"])){
|
|
|
+ $data["avg_level"] = round($data["avg_level"], 1);
|
|
|
+ $data["pasttimeTips"] = bizbase_pasttimeTips($data["createtime"]);
|
|
|
+ $data["createtime"] = date("Y-m-d H:i:s", $data["createtime"]);
|
|
|
+ $data["fromWorkerId"] = $data["fromerid"];
|
|
|
+ $data["fromTraderId"] = $data["fromerid"];
|
|
|
+ $data["toWorkerId"] = $data["toerid"];
|
|
|
+ $data["toTraderId"] = $data["toerid"];
|
|
|
+ $data["activityId"] = $data["market_activityid"];
|
|
|
+ $data["recuritId"] = $data["biz_recruitid"];
|
|
|
+ switch (intval($data["biz_catalog"])) {
|
|
|
case 0:
|
|
|
- $data["biz_catalogName"]="会员对活动评价";
|
|
|
- $data["apa_biztitle"]=$data["bma_title"];
|
|
|
- $data["apaer_name"]=$data["fwk_truename"];
|
|
|
- $data["apaer_mobile"]=$data["fwkbu_mobile"];
|
|
|
- $data["apaee_name"]="";
|
|
|
- $data["apaee_mobile"]="";
|
|
|
+ $data["biz_catalogName"] = "会员对活动评价";
|
|
|
+ $data["apa_biztitle"] = $data["bma_title"];
|
|
|
+ $data["apaer_name"] = $data["fwk_truename"];
|
|
|
+ $data["apaer_mobile"] = $data["fwkbu_mobile"];
|
|
|
+ $data["apaee_name"] = "";
|
|
|
+ $data["apaee_mobile"] = "";
|
|
|
break;
|
|
|
case 1:
|
|
|
- $data["biz_catalogName"]="会员基于工作过程对雇主评价";
|
|
|
- $data["apa_biztitle"]=$data["btr_title"];
|
|
|
- $data["apaer_name"]=$data["fwk_truename"];
|
|
|
- $data["apaer_mobile"]=$data["fwkbu_mobile"];
|
|
|
- $data["apaee_name"]=$data["tbt_companyname"];
|
|
|
- $data["apaee_mobile"]=$data["tbtbu_mobile"];
|
|
|
+ $data["biz_catalogName"] = "会员基于工作过程对雇主评价";
|
|
|
+ $data["apa_biztitle"] = $data["btr_title"];
|
|
|
+ $data["apaer_name"] = $data["fwk_truename"];
|
|
|
+ $data["apaer_mobile"] = $data["fwkbu_mobile"];
|
|
|
+ $data["apaee_name"] = $data["tbt_companyname"];
|
|
|
+ $data["apaee_mobile"] = $data["tbtbu_mobile"];
|
|
|
break;
|
|
|
case 2:
|
|
|
- $data["biz_catalogName"]="商家基于工作过程对会员评价";
|
|
|
- $data["apa_biztitle"]=$data["btr_title"];
|
|
|
- $data["apaer_name"]=$data["fbt_companyname"];
|
|
|
- $data["apaer_mobile"]=$data["fbtbu_mobile"];
|
|
|
- $data["apaee_name"]=$data["twk_truename"];
|
|
|
- $data["apaee_mobile"]=$data["twkbu_mobile"];
|
|
|
+ $data["biz_catalogName"] = "商家基于工作过程对会员评价";
|
|
|
+ $data["apa_biztitle"] = $data["btr_title"];
|
|
|
+ $data["apaer_name"] = $data["fbt_companyname"];
|
|
|
+ $data["apaer_mobile"] = $data["fbtbu_mobile"];
|
|
|
+ $data["apaee_name"] = $data["twk_truename"];
|
|
|
+ $data["apaee_mobile"] = $data["twkbu_mobile"];
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- $sqlSummary=" select count(*) as count ".$sqlSummaryPre.$sqlBody.$sqlSummaryPost.";";
|
|
|
- $sumData=pdo_fetch($sqlSummary,$sqlParam);
|
|
|
+ $sqlSummary = " select count(*) as count " . $sqlSummaryPre . $sqlBody . $sqlSummaryPost . ";";
|
|
|
+ $sumData = pdo_fetch($sqlSummary, $sqlParam);
|
|
|
return array(
|
|
|
"pageData" => $pageData,
|
|
|
"count" => intval($sumData["count"]),
|
|
|
- );
|
|
|
- break;
|
|
|
+ );
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**********************交互沟通相关逻辑**************************************/
|
|
|
-function bizbase_interactionEntityHandle($subSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL2_MINA) $bizTrader2 = $bizUser;
|
|
|
- switch($handleMode){
|
|
|
- case "fetchLastSuggestion":
|
|
|
- $lastdata = bizbase_interactionLastSuggestion($bizUser);
|
|
|
- if(empty($lastdata)) return false;
|
|
|
- $lastdata["statusName"]=bizbase_interactionStatusName($lastdata["status"]);
|
|
|
+function bizbase_interactionEntityHandle($subSystem, $baseUser, $bizUser, $handleMode, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL2_MINA) {
|
|
|
+ $bizTrader2 = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($handleMode) {
|
|
|
+ case "fetchLastSuggestion":
|
|
|
+ $lastdata = bizbase_interactionLastSuggestion($bizUser);
|
|
|
+ if (empty($lastdata)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ $lastdata["statusName"] = bizbase_interactionStatusName($lastdata["status"]);
|
|
|
return $lastdata;
|
|
|
- break;
|
|
|
- case "fetchSuggestion":
|
|
|
+ break;
|
|
|
+ case "fetchSuggestion":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" select ita.*";
|
|
|
- $sqlTemp.=" ,(case when wk.true_name<>'' then wk.true_name else wk.nickname end) as wk_truename,wkbu.mobile as wkbu_mobile,wk.profile_photo as wk_profile_photo ";
|
|
|
- $sqlTemp.=" ,bt.company_name as bt_truename,btbu.mobile as btbu_mobile ";
|
|
|
- $sqlTemp.=" ,(select content from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_content";
|
|
|
- $sqlTemp.=" ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_picurls";
|
|
|
- $sqlTemp.=" ,(select content from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_content";
|
|
|
- $sqlTemp.=" ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_picurls";
|
|
|
- $sqlTemp.=" from biz_interaction ita";
|
|
|
- $sqlTemp.=" left join biz_worker wk on wk.id=ita.fromerid ";
|
|
|
- $sqlTemp.=" left join base_user wkbu on wkbu.id=wk.base_userid ";
|
|
|
- $sqlTemp.=" left join biz_trader bt on bt.id=ita.fromerid ";
|
|
|
- $sqlTemp.=" left join base_user btbu on btbu.id=bt.base_userid ";
|
|
|
- $sqlTemp.=" where ita.id=".intval($bizId);
|
|
|
- $datainfo = pdo_fetch($sqlTemp);
|
|
|
- if(empty($datainfo)) throw new GeneralException("","没有定位到记录!");
|
|
|
- if (intval($datainfo["biz_catalog"]) >1) throw new GeneralException("", "当前记录不是意见反馈类别");
|
|
|
- $datainfo["createtime"]=date("Y-m-d H:i:s",$datainfo["createtime"]);
|
|
|
- $datainfo["finishtime"]=date("Y-m-d H:i:s",$datainfo["finishtime"]);
|
|
|
- $datainfo["statusName"]=bizbase_interactionStatusName($datainfo["status"]);
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " select ita.*";
|
|
|
+ $sqlTemp .= " ,(case when wk.true_name<>'' then wk.true_name else wk.nickname end) as wk_truename,wkbu.mobile as wkbu_mobile,wk.profile_photo as wk_profile_photo ";
|
|
|
+ $sqlTemp .= " ,bt.company_name as bt_truename,btbu.mobile as btbu_mobile ";
|
|
|
+ $sqlTemp .= " ,(select content from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_content";
|
|
|
+ $sqlTemp .= " ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_picurls";
|
|
|
+ $sqlTemp .= " ,(select content from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_content";
|
|
|
+ $sqlTemp .= " ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_picurls";
|
|
|
+ $sqlTemp .= " from biz_interaction ita";
|
|
|
+ $sqlTemp .= " left join biz_worker wk on wk.id=ita.fromerid ";
|
|
|
+ $sqlTemp .= " left join base_user wkbu on wkbu.id=wk.base_userid ";
|
|
|
+ $sqlTemp .= " left join biz_trader bt on bt.id=ita.fromerid ";
|
|
|
+ $sqlTemp .= " left join base_user btbu on btbu.id=bt.base_userid ";
|
|
|
+ $sqlTemp .= " where ita.id=" . intval($bizId);
|
|
|
+ $datainfo = pdo_fetch($sqlTemp);
|
|
|
+ if (empty($datainfo)) {
|
|
|
+ throw new GeneralException("", "没有定位到记录!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["biz_catalog"]) > 1) {
|
|
|
+ throw new GeneralException("", "当前记录不是意见反馈类别");
|
|
|
+ }
|
|
|
+
|
|
|
+ $datainfo["createtime"] = date("Y-m-d H:i:s", $datainfo["createtime"]);
|
|
|
+ $datainfo["finishtime"] = date("Y-m-d H:i:s", $datainfo["finishtime"]);
|
|
|
+ $datainfo["statusName"] = bizbase_interactionStatusName($datainfo["status"]);
|
|
|
unset($datainfo["remark"]);
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_PLAT_PCWEB){
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":nowtime"]=time();
|
|
|
- $sqlParam[":biz_id"]=intval($datainfo["id"]);
|
|
|
- $sqlTemp ="";
|
|
|
- $sqlTemp.=" set @handle_id=0; ";
|
|
|
- $sqlTemp.=" select @handle_id:=id from biz_interaction where id=:biz_id and ifnull(readed,0)=0 limit 1;";
|
|
|
- $sqlTemp.=" update biz_interaction set `updatetime`=:nowtime,readed=1 where ifnull(@handle_id,0)=0 and id=:biz_id;";
|
|
|
- $dataset = pdo_query3($sqlTemp,$sqlParam);
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_PLAT_PCWEB) {
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":nowtime"] = time();
|
|
|
+ $sqlParam[":biz_id"] = intval($datainfo["id"]);
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " set @handle_id=0; ";
|
|
|
+ $sqlTemp .= " select @handle_id:=id from biz_interaction where id=:biz_id and ifnull(readed,0)=0 limit 1;";
|
|
|
+ $sqlTemp .= " update biz_interaction set `updatetime`=:nowtime,readed=1 where ifnull(@handle_id,0)=0 and id=:biz_id;";
|
|
|
+ $dataset = pdo_query3($sqlTemp, $sqlParam);
|
|
|
}
|
|
|
return $datainfo;
|
|
|
- break;
|
|
|
- case "submitNewSuggestion":
|
|
|
- if(empty($bizWorker) && empty($bizTrader)) throw new GeneralException("","当前用户类别不正确!");
|
|
|
- $lastdata = bizbase_interactionLastSuggestion($bizUser);
|
|
|
- if(!empty($lastdata) && intval($lastdata["status"])<3) throw new GeneralException("","当前意见反馈还未完结");
|
|
|
+ break;
|
|
|
+ case "submitNewSuggestion":
|
|
|
+ if (empty($bizWorker) && empty($bizTrader)) {
|
|
|
+ throw new GeneralException("", "当前用户类别不正确!");
|
|
|
+ }
|
|
|
+
|
|
|
+ $lastdata = bizbase_interactionLastSuggestion($bizUser);
|
|
|
+ if (!empty($lastdata) && intval($lastdata["status"]) < 3) {
|
|
|
+ throw new GeneralException("", "当前意见反馈还未完结");
|
|
|
+ }
|
|
|
+
|
|
|
$content = isset($ajaxdata["content"]) ? $ajaxdata["content"] : $GPC["content"];
|
|
|
- if (empty(trim($content))) throw new GeneralException("", "没有传递必要的content参数或内容为空");
|
|
|
- $sqlParam=array(
|
|
|
- ":nowtime"=>time(),
|
|
|
- ":userid"=>$bizUser["id"],
|
|
|
+ if (empty(trim($content))) {
|
|
|
+ throw new GeneralException("", "没有传递必要的content参数或内容为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ $sqlParam = array(
|
|
|
+ ":nowtime" => time(),
|
|
|
+ ":userid" => $bizUser["id"],
|
|
|
":biz_catalog" => (empty($bizTrader) ? 0 : 1),
|
|
|
- ":content"=>$content,
|
|
|
+ ":content" => $content,
|
|
|
);
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" insert into biz_interaction set createtime=:nowtime, biz_catalog=:biz_catalog, fromerid=:userid, `status`=1;";
|
|
|
- $sqlTemp.=" insert into biz_interaction_talk set createtime=:nowtime ";
|
|
|
- $sqlTemp.=" , parentid=LAST_INSERT_ID(), catalog=0, content=:content; ";
|
|
|
- $backdata = pdo_query($sqlTemp,$sqlParam);
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " insert into biz_interaction set createtime=:nowtime, biz_catalog=:biz_catalog, fromerid=:userid, `status`=1;";
|
|
|
+ $sqlTemp .= " insert into biz_interaction_talk set createtime=:nowtime ";
|
|
|
+ $sqlTemp .= " , parentid=LAST_INSERT_ID(), catalog=0, content=:content; ";
|
|
|
+ $backdata = pdo_query($sqlTemp, $sqlParam);
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "finishSuggestion":
|
|
|
+ break;
|
|
|
+ case "finishSuggestion":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- $datainfo = pdo_fetch("select * from biz_interaction where id=" . intval($bizId));
|
|
|
- if(empty($datainfo)) throw new GeneralException("","没有定位到记录!");
|
|
|
- if (intval($datainfo["status"]) != 1) throw new GeneralException("", "当前意见反馈不是待回复状态");
|
|
|
- if (intval($datainfo["biz_catalog"]) >= 2) throw new GeneralException("", "当前记录不是意见反馈类别");
|
|
|
+ $datainfo = pdo_fetch("select * from biz_interaction where id=" . intval($bizId));
|
|
|
+ if (empty($datainfo)) {
|
|
|
+ throw new GeneralException("", "没有定位到记录!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["status"]) != 1) {
|
|
|
+ throw new GeneralException("", "当前意见反馈不是待回复状态");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["biz_catalog"]) >= 2) {
|
|
|
+ throw new GeneralException("", "当前记录不是意见反馈类别");
|
|
|
+ }
|
|
|
+
|
|
|
$replyContent = isset($ajaxdata["replyContent"]) ? $ajaxdata["replyContent"] : $GPC["replyContent"];
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" update biz_interaction set updatetime=:nowtime, finishtime=:nowtime, `status`=3, remark=concat(:remark,ifnull(remark,'')) where id=:itaid;";
|
|
|
- $sqlTemp.=" insert into biz_interaction_talk set createtime=:nowtime ";
|
|
|
- $sqlTemp.=" , parentid=:itaid, catalog=1, content=:content; ";
|
|
|
- $backdata = pdo_query($sqlTemp,array(
|
|
|
- ":nowtime"=>time(),":itaid"=>$datainfo["id"],
|
|
|
- ":content"=>$replyContent,":remark"=>"[".date("Y-m-d H:i:s",time())."] 回复后结单 \n"));
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " update biz_interaction set updatetime=:nowtime, finishtime=:nowtime, `status`=3, remark=concat(:remark,ifnull(remark,'')) where id=:itaid;";
|
|
|
+ $sqlTemp .= " insert into biz_interaction_talk set createtime=:nowtime ";
|
|
|
+ $sqlTemp .= " , parentid=:itaid, catalog=1, content=:content; ";
|
|
|
+ $backdata = pdo_query($sqlTemp, array(
|
|
|
+ ":nowtime" => time(), ":itaid" => $datainfo["id"],
|
|
|
+ ":content" => $replyContent, ":remark" => "[" . date("Y-m-d H:i:s", time()) . "] 回复后结单 \n"));
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "deleteSuggestion":
|
|
|
+ break;
|
|
|
+ case "deleteSuggestion":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- $datainfo = pdo_fetch("select * from biz_interaction where id=" . intval($bizId));
|
|
|
- if(empty($datainfo)) throw new GeneralException("","没有定位到记录!");
|
|
|
- if (intval($datainfo["deleted"]) != 0) throw new GeneralException("", "当前意见反馈已删除了,不能重复删除");
|
|
|
- if (intval($datainfo["status"]) != 3) throw new GeneralException("", "当前意见反馈不是已完结状态,不能删除");
|
|
|
- if (intval($datainfo["biz_catalog"]) >= 2) throw new GeneralException("", "当前记录不是意见反馈类别");
|
|
|
+ $datainfo = pdo_fetch("select * from biz_interaction where id=" . intval($bizId));
|
|
|
+ if (empty($datainfo)) {
|
|
|
+ throw new GeneralException("", "没有定位到记录!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["deleted"]) != 0) {
|
|
|
+ throw new GeneralException("", "当前意见反馈已删除了,不能重复删除");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["status"]) != 3) {
|
|
|
+ throw new GeneralException("", "当前意见反馈不是已完结状态,不能删除");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["biz_catalog"]) >= 2) {
|
|
|
+ throw new GeneralException("", "当前记录不是意见反馈类别");
|
|
|
+ }
|
|
|
+
|
|
|
$reason = isset($ajaxdata["reason"]) ? $ajaxdata["reason"] : $GPC["reason"];
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" update biz_interaction set updatetime=:nowtime, `deleted`=1, remark=concat(:remark,ifnull(remark,'')) where id=:itaid;";
|
|
|
- $backdata = pdo_query($sqlTemp,array(
|
|
|
- ":nowtime"=>time(),":itaid"=>$datainfo["id"],
|
|
|
- ":remark"=>"[".date("Y-m-d H:i:s",time())."] 删除 {$reason} \n"));
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " update biz_interaction set updatetime=:nowtime, `deleted`=1, remark=concat(:remark,ifnull(remark,'')) where id=:itaid;";
|
|
|
+ $backdata = pdo_query($sqlTemp, array(
|
|
|
+ ":nowtime" => time(), ":itaid" => $datainfo["id"],
|
|
|
+ ":remark" => "[" . date("Y-m-d H:i:s", time()) . "] 删除 {$reason} \n"));
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "fetchComplaint":
|
|
|
+ break;
|
|
|
+ case "fetchComplaint":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" select ita.*";
|
|
|
- $sqlTemp.=" ,(case when wk.true_name<>'' then wk.true_name else wk.nickname end) as wk_truename,wkbu.mobile as wkbu_mobile,wk.profile_photo as wk_profile_photo ";
|
|
|
- $sqlTemp.=" ,bt.company_name as bt_truename,btbu.mobile as btbu_mobile ";
|
|
|
- $sqlTemp.=" ,btr.title as btr_title ";
|
|
|
- $sqlTemp.=" ,(select content from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_content";
|
|
|
- $sqlTemp.=" ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_picurls";
|
|
|
- $sqlTemp.=" ,(select content from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_content";
|
|
|
- $sqlTemp.=" ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_picurls";
|
|
|
- $sqlTemp.=" from biz_interaction ita ";
|
|
|
- $sqlTemp.=" left join biz_worker wk on wk.id=ita.fromerid ";
|
|
|
- $sqlTemp.=" left join base_user wkbu on wkbu.id=wk.base_userid ";
|
|
|
- $sqlTemp.=" left join biz_trader bt on ita.biz_catalog>=2 and bt.id=ita.objectid ";
|
|
|
- $sqlTemp.=" left join base_user btbu on ita.biz_catalog>=2 and btbu.id=bt.base_userid ";
|
|
|
- $sqlTemp.=" left join biz_todowork tdwk on ita.biz_catalog>=2 and tdwk.id=ita.biz_id";
|
|
|
- $sqlTemp.=" left join biz_trader_recruit btr on ita.biz_catalog>=2 and (btr.id=tdwk.biz_recruitid or btr.id=ita.biz_id)";
|
|
|
- $sqlTemp.=" where ita.id=".intval($bizId);
|
|
|
- $datainfo = pdo_fetch($sqlTemp);
|
|
|
- if(empty($datainfo)) throw new GeneralException("","没有定位到记录!");
|
|
|
- if (intval($datainfo["biz_catalog"]) <2) throw new GeneralException("", "当前记录不是投诉类别");
|
|
|
- if (!empty($bizWorker) && intval($datainfo["fromerid"]) !=intval($bizWorker["id"])) throw new GeneralException("", "当前记录不是您发起的");
|
|
|
- $datainfo["createtime"]=date("Y-m-d H:i:s",$datainfo["createtime"]);
|
|
|
- $datainfo["finishtime"]=date("Y-m-d H:i:s",$datainfo["finishtime"]);
|
|
|
- $datainfo["statusName"]=bizbase_interactionStatusName($datainfo["status"]);
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " select ita.*";
|
|
|
+ $sqlTemp .= " ,(case when wk.true_name<>'' then wk.true_name else wk.nickname end) as wk_truename,wkbu.mobile as wkbu_mobile,wk.profile_photo as wk_profile_photo ";
|
|
|
+ $sqlTemp .= " ,bt.company_name as bt_truename,btbu.mobile as btbu_mobile ";
|
|
|
+ $sqlTemp .= " ,btr.title as btr_title ";
|
|
|
+ $sqlTemp .= " ,(select content from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_content";
|
|
|
+ $sqlTemp .= " ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_picurls";
|
|
|
+ $sqlTemp .= " ,(select content from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_content";
|
|
|
+ $sqlTemp .= " ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_picurls";
|
|
|
+ $sqlTemp .= " from biz_interaction ita ";
|
|
|
+ $sqlTemp .= " left join biz_worker wk on wk.id=ita.fromerid ";
|
|
|
+ $sqlTemp .= " left join base_user wkbu on wkbu.id=wk.base_userid ";
|
|
|
+ $sqlTemp .= " left join biz_trader bt on ita.biz_catalog>=2 and bt.id=ita.objectid ";
|
|
|
+ $sqlTemp .= " left join base_user btbu on ita.biz_catalog>=2 and btbu.id=bt.base_userid ";
|
|
|
+ $sqlTemp .= " left join biz_todowork tdwk on ita.biz_catalog>=2 and tdwk.id=ita.biz_id";
|
|
|
+ $sqlTemp .= " left join biz_trader_recruit btr on ita.biz_catalog>=2 and (btr.id=tdwk.biz_recruitid or btr.id=ita.biz_id)";
|
|
|
+ $sqlTemp .= " where ita.id=" . intval($bizId);
|
|
|
+ $datainfo = pdo_fetch($sqlTemp);
|
|
|
+ if (empty($datainfo)) {
|
|
|
+ throw new GeneralException("", "没有定位到记录!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["biz_catalog"]) < 2) {
|
|
|
+ throw new GeneralException("", "当前记录不是投诉类别");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!empty($bizWorker) && intval($datainfo["fromerid"]) != intval($bizWorker["id"])) {
|
|
|
+ throw new GeneralException("", "当前记录不是您发起的");
|
|
|
+ }
|
|
|
+
|
|
|
+ $datainfo["createtime"] = date("Y-m-d H:i:s", $datainfo["createtime"]);
|
|
|
+ $datainfo["finishtime"] = date("Y-m-d H:i:s", $datainfo["finishtime"]);
|
|
|
+ $datainfo["statusName"] = bizbase_interactionStatusName($datainfo["status"]);
|
|
|
unset($datainfo["remark"]);
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_PLAT_PCWEB){
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":nowtime"]=time();
|
|
|
- $sqlParam[":biz_id"]=intval($datainfo["id"]);
|
|
|
- $sqlTemp ="";
|
|
|
- $sqlTemp.=" set @handle_id=0; ";
|
|
|
- $sqlTemp.=" select @handle_id:=id from biz_interaction where id=:biz_id and ifnull(readed,0)=0 limit 1;";
|
|
|
- $sqlTemp.=" update biz_interaction set `updatetime`=:nowtime,readed=1 where ifnull(@handle_id,0)=0 and id=:biz_id;";
|
|
|
- $dataset = pdo_query3($sqlTemp,$sqlParam);
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_PLAT_PCWEB) {
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":nowtime"] = time();
|
|
|
+ $sqlParam[":biz_id"] = intval($datainfo["id"]);
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " set @handle_id=0; ";
|
|
|
+ $sqlTemp .= " select @handle_id:=id from biz_interaction where id=:biz_id and ifnull(readed,0)=0 limit 1;";
|
|
|
+ $sqlTemp .= " update biz_interaction set `updatetime`=:nowtime,readed=1 where ifnull(@handle_id,0)=0 and id=:biz_id;";
|
|
|
+ $dataset = pdo_query3($sqlTemp, $sqlParam);
|
|
|
}
|
|
|
return $datainfo;
|
|
|
- break;
|
|
|
- case "submitNewComplaint":
|
|
|
+ break;
|
|
|
+ case "submitNewComplaint":
|
|
|
$content = isset($ajaxdata["content"]) ? $ajaxdata["content"] : $GPC["content"];
|
|
|
- if (empty(trim($content))) throw new GeneralException("", "没有传递必要的content参数或内容为空");
|
|
|
- $sqlParam=array();
|
|
|
- $sqlParam[":nowtime"]=time();
|
|
|
- $sqlParam[":workerid"]=$bizWorker["id"];
|
|
|
- $sqlParam[":content"]=$content;
|
|
|
+ if (empty(trim($content))) {
|
|
|
+ throw new GeneralException("", "没有传递必要的content参数或内容为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ $sqlParam = array();
|
|
|
+ $sqlParam[":nowtime"] = time();
|
|
|
+ $sqlParam[":workerid"] = $bizWorker["id"];
|
|
|
+ $sqlParam[":content"] = $content;
|
|
|
$workId = isset($ajaxdata["workid"]) ? $ajaxdata["workid"] : $GPC["workid"];
|
|
|
- if(intval($workId)>0){
|
|
|
- $workInfo = pdo_fetch("select tdwk.*
|
|
|
+ if (intval($workId) > 0) {
|
|
|
+ $workInfo = pdo_fetch("select tdwk.*
|
|
|
,btr.biz_traderid, btr.feetotal as pay_feetotal
|
|
|
- from biz_todowork tdwk
|
|
|
+ from biz_todowork tdwk
|
|
|
left join biz_trader_recruit btr on btr.id=tdwk.biz_recruitid
|
|
|
where tdwk.id=" . intval($workId));
|
|
|
- if (empty($workInfo)) throw new GeneralException("", "订单id没有对应的记录,请核查!");
|
|
|
- if (intval($workInfo["biz_traderid"])<=0) throw new GeneralException("", "订单id没有对应的商家记录,请核查!");
|
|
|
- $sqlParam[":biz_catalog"]=3;
|
|
|
- $sqlParam[":biz_id"]=intval($workId);
|
|
|
- $sqlParam[":objectid"]=intval($workInfo["biz_traderid"]);
|
|
|
- $lastData = pdo_fetch("select * from biz_interaction
|
|
|
- where fromerid=:workerid and biz_catalog=:biz_catalog and `biz_id`=:biz_id and `objectid`=:objectid
|
|
|
- order by id desc limit 1",array(
|
|
|
- ":workerid"=>$sqlParam[":workerid"],
|
|
|
- ":biz_catalog"=>$sqlParam[":biz_catalog"],
|
|
|
- ":biz_id"=>$sqlParam[":biz_id"],
|
|
|
- ":objectid"=>$sqlParam[":objectid"],
|
|
|
+ if (empty($workInfo)) {
|
|
|
+ throw new GeneralException("", "订单id没有对应的记录,请核查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($workInfo["biz_traderid"]) <= 0) {
|
|
|
+ throw new GeneralException("", "订单id没有对应的商家记录,请核查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ $sqlParam[":biz_catalog"] = 3;
|
|
|
+ $sqlParam[":biz_id"] = intval($workId);
|
|
|
+ $sqlParam[":objectid"] = intval($workInfo["biz_traderid"]);
|
|
|
+ $lastData = pdo_fetch("select * from biz_interaction
|
|
|
+ where fromerid=:workerid and biz_catalog=:biz_catalog and `biz_id`=:biz_id and `objectid`=:objectid
|
|
|
+ order by id desc limit 1", array(
|
|
|
+ ":workerid" => $sqlParam[":workerid"],
|
|
|
+ ":biz_catalog" => $sqlParam[":biz_catalog"],
|
|
|
+ ":biz_id" => $sqlParam[":biz_id"],
|
|
|
+ ":objectid" => $sqlParam[":objectid"],
|
|
|
));
|
|
|
- if (!empty($lastData) && intval($lastData["status"])<3) throw new GeneralException("waitSettle", "此订单的投诉还未处理,请等待处理后再提交新的投诉吧!");
|
|
|
- }else{
|
|
|
+ if (!empty($lastData) && intval($lastData["status"]) < 3) {
|
|
|
+ throw new GeneralException("waitSettle", "此订单的投诉还未处理,请等待处理后再提交新的投诉吧!");
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
bizbase_verifyUserAccount($bizWorker, true, "无法投诉");
|
|
|
$recuritid = isset($ajaxdata["recuritid"]) ? $ajaxdata["recuritid"] : $GPC["recuritid"];
|
|
|
- if(intval($recuritid)<=0) throw new GeneralException("", "没有传递必要的workid/recuritid参数或值为空");
|
|
|
+ if (intval($recuritid) <= 0) {
|
|
|
+ throw new GeneralException("", "没有传递必要的workid/recuritid参数或值为空");
|
|
|
+ }
|
|
|
+
|
|
|
$recuritInfo = pdo_fetch("select * from biz_trader_recruit where id=" . intval($recuritid));
|
|
|
- if (empty($recuritInfo)) throw new GeneralException("", "招聘id没有对应的记录,请核查!");
|
|
|
- if (intval($recuritInfo["biz_traderid"])<=0) throw new GeneralException("", "招聘id没有对应的商家记录,请核查!");
|
|
|
- $sqlParam[":biz_catalog"]=2;
|
|
|
- $sqlParam[":biz_id"]=intval($recuritid);
|
|
|
- $sqlParam[":objectid"]=intval($recuritInfo["biz_traderid"]);
|
|
|
- $lastData = pdo_fetch("select * from biz_interaction
|
|
|
- where fromerid=:workerid and biz_catalog=:biz_catalog and `biz_id`=:biz_id and `objectid`=:objectid
|
|
|
- order by id desc limit 1",array(
|
|
|
- ":workerid"=>$sqlParam[":workerid"],
|
|
|
- ":biz_catalog"=>$sqlParam[":biz_catalog"],
|
|
|
- ":biz_id"=>$sqlParam[":biz_id"],
|
|
|
- ":objectid"=>$sqlParam[":objectid"],
|
|
|
+ if (empty($recuritInfo)) {
|
|
|
+ throw new GeneralException("", "招聘id没有对应的记录,请核查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($recuritInfo["biz_traderid"]) <= 0) {
|
|
|
+ throw new GeneralException("", "招聘id没有对应的商家记录,请核查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ $sqlParam[":biz_catalog"] = 2;
|
|
|
+ $sqlParam[":biz_id"] = intval($recuritid);
|
|
|
+ $sqlParam[":objectid"] = intval($recuritInfo["biz_traderid"]);
|
|
|
+ $lastData = pdo_fetch("select * from biz_interaction
|
|
|
+ where fromerid=:workerid and biz_catalog=:biz_catalog and `biz_id`=:biz_id and `objectid`=:objectid
|
|
|
+ order by id desc limit 1", array(
|
|
|
+ ":workerid" => $sqlParam[":workerid"],
|
|
|
+ ":biz_catalog" => $sqlParam[":biz_catalog"],
|
|
|
+ ":biz_id" => $sqlParam[":biz_id"],
|
|
|
+ ":objectid" => $sqlParam[":objectid"],
|
|
|
));
|
|
|
- if (!empty($lastData) && intval($lastData["status"])<3) throw new GeneralException("waitSettle", "此招聘的投诉还未处理,请等待处理后再提交新的投诉吧!");
|
|
|
- }
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" insert into biz_interaction set createtime=:nowtime";
|
|
|
- $sqlTemp.=" ,biz_catalog=:biz_catalog, `biz_id`=:biz_id ";
|
|
|
- $sqlTemp.=" ,fromerid=:workerid, objectid=:objectid, `status`=1; ";
|
|
|
- $sqlTemp.=" insert into biz_interaction_talk set createtime=:nowtime ";
|
|
|
- $sqlTemp.=" ,parentid=LAST_INSERT_ID(), catalog=0, content=:content; ";
|
|
|
- $backdata = pdo_query($sqlTemp, $sqlParam);
|
|
|
+ if (!empty($lastData) && intval($lastData["status"]) < 3) {
|
|
|
+ throw new GeneralException("waitSettle", "此招聘的投诉还未处理,请等待处理后再提交新的投诉吧!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " insert into biz_interaction set createtime=:nowtime";
|
|
|
+ $sqlTemp .= " ,biz_catalog=:biz_catalog, `biz_id`=:biz_id ";
|
|
|
+ $sqlTemp .= " ,fromerid=:workerid, objectid=:objectid, `status`=1; ";
|
|
|
+ $sqlTemp .= " insert into biz_interaction_talk set createtime=:nowtime ";
|
|
|
+ $sqlTemp .= " ,parentid=LAST_INSERT_ID(), catalog=0, content=:content; ";
|
|
|
+ $backdata = pdo_query($sqlTemp, $sqlParam);
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "finishComplaint":
|
|
|
+ break;
|
|
|
+ case "finishComplaint":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- $datainfo = pdo_fetch("select * from biz_interaction where id=" . intval($bizId));
|
|
|
- if(empty($datainfo)) throw new GeneralException("","没有定位到记录!");
|
|
|
- if (intval($datainfo["status"]) != 1) throw new GeneralException("", "当前投诉记录不是待回复状态");
|
|
|
- if (intval($datainfo["biz_catalog"]) <2) throw new GeneralException("", "当前记录不是投诉类别");
|
|
|
+ $datainfo = pdo_fetch("select * from biz_interaction where id=" . intval($bizId));
|
|
|
+ if (empty($datainfo)) {
|
|
|
+ throw new GeneralException("", "没有定位到记录!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["status"]) != 1) {
|
|
|
+ throw new GeneralException("", "当前投诉记录不是待回复状态");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["biz_catalog"]) < 2) {
|
|
|
+ throw new GeneralException("", "当前记录不是投诉类别");
|
|
|
+ }
|
|
|
+
|
|
|
$replyContent = isset($ajaxdata["replyContent"]) ? $ajaxdata["replyContent"] : $GPC["replyContent"];
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" update biz_interaction set updatetime=:nowtime, finishtime=:nowtime, `status`=3, remark=concat(:remark,ifnull(remark,'')) where id=:itaid;";
|
|
|
- $sqlTemp.=" insert into biz_interaction_talk set createtime=:nowtime ";
|
|
|
- $sqlTemp.=" , parentid=:itaid, catalog=1, content=:content; ";
|
|
|
- $backdata = pdo_query($sqlTemp,array(
|
|
|
- ":nowtime"=>time(),":itaid"=>$datainfo["id"],
|
|
|
- ":content"=>$replyContent,":remark"=>"[".date("Y-m-d H:i:s",time())."] 回复后结单 \n"));
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " update biz_interaction set updatetime=:nowtime, finishtime=:nowtime, `status`=3, remark=concat(:remark,ifnull(remark,'')) where id=:itaid;";
|
|
|
+ $sqlTemp .= " insert into biz_interaction_talk set createtime=:nowtime ";
|
|
|
+ $sqlTemp .= " , parentid=:itaid, catalog=1, content=:content; ";
|
|
|
+ $backdata = pdo_query($sqlTemp, array(
|
|
|
+ ":nowtime" => time(), ":itaid" => $datainfo["id"],
|
|
|
+ ":content" => $replyContent, ":remark" => "[" . date("Y-m-d H:i:s", time()) . "] 回复后结单 \n"));
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "deleteComplaint":
|
|
|
+ break;
|
|
|
+ case "deleteComplaint":
|
|
|
$bizId = isset($ajaxdata["bizId"]) ? $ajaxdata["bizId"] : $GPC["bizId"];
|
|
|
- $datainfo = pdo_fetch("select * from biz_interaction where id=" . intval($bizId));
|
|
|
- if(empty($datainfo)) throw new GeneralException("","没有定位到记录!");
|
|
|
- if (intval($datainfo["deleted"]) != 0) throw new GeneralException("", "当前投诉记录已删除了,不能重复删除");
|
|
|
- if (intval($datainfo["status"]) != 3) throw new GeneralException("", "当前投诉记录不是已完结状态,不能删除");
|
|
|
- if (intval($datainfo["biz_catalog"]) <2) throw new GeneralException("", "当前记录不是投诉类别");
|
|
|
+ $datainfo = pdo_fetch("select * from biz_interaction where id=" . intval($bizId));
|
|
|
+ if (empty($datainfo)) {
|
|
|
+ throw new GeneralException("", "没有定位到记录!");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["deleted"]) != 0) {
|
|
|
+ throw new GeneralException("", "当前投诉记录已删除了,不能重复删除");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["status"]) != 3) {
|
|
|
+ throw new GeneralException("", "当前投诉记录不是已完结状态,不能删除");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($datainfo["biz_catalog"]) < 2) {
|
|
|
+ throw new GeneralException("", "当前记录不是投诉类别");
|
|
|
+ }
|
|
|
+
|
|
|
$reason = isset($ajaxdata["reason"]) ? $ajaxdata["reason"] : $GPC["reason"];
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" update biz_interaction set updatetime=:nowtime, `deleted`=1, remark=concat(:remark,ifnull(remark,'')) where id=:itaid;";
|
|
|
- $backdata = pdo_query($sqlTemp,array(
|
|
|
- ":nowtime"=>time(),":itaid"=>$datainfo["id"],
|
|
|
- ":remark"=>"[".date("Y-m-d H:i:s",time())."] 删除 {$reason} \n"));
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " update biz_interaction set updatetime=:nowtime, `deleted`=1, remark=concat(:remark,ifnull(remark,'')) where id=:itaid;";
|
|
|
+ $backdata = pdo_query($sqlTemp, array(
|
|
|
+ ":nowtime" => time(), ":itaid" => $datainfo["id"],
|
|
|
+ ":remark" => "[" . date("Y-m-d H:i:s", time()) . "] 删除 {$reason} \n"));
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
-function bizbase_interactionStatusName($status){
|
|
|
- $statusName="";
|
|
|
- switch(intval($status)){
|
|
|
+function bizbase_interactionStatusName($status)
|
|
|
+{
|
|
|
+ $statusName = "";
|
|
|
+ switch (intval($status)) {
|
|
|
case 0:
|
|
|
- $statusName="待提交草稿";
|
|
|
+ $statusName = "待提交草稿";
|
|
|
break;
|
|
|
case 1:
|
|
|
- $statusName="已提交待回复";
|
|
|
+ $statusName = "已提交待回复";
|
|
|
break;
|
|
|
case 2:
|
|
|
- $statusName="已回复待继续咨询";
|
|
|
+ $statusName = "已回复待继续咨询";
|
|
|
break;
|
|
|
case 3:
|
|
|
- $statusName="已结束会话待发起者评价";
|
|
|
+ $statusName = "已结束会话待发起者评价";
|
|
|
break;
|
|
|
case 4:
|
|
|
- $statusName="发起者评价待处理者评价";
|
|
|
+ $statusName = "发起者评价待处理者评价";
|
|
|
break;
|
|
|
case 5:
|
|
|
- $statusName="处理者已评价结单";
|
|
|
+ $statusName = "处理者已评价结单";
|
|
|
break;
|
|
|
}
|
|
|
return $statusName;
|
|
|
}
|
|
|
-function bizbase_interactionLastSuggestion($bizWorkerTrader){
|
|
|
- $sqlParam=array();
|
|
|
- switch(intval($bizWorkerTrader["subsystem"])){
|
|
|
+function bizbase_interactionLastSuggestion($bizWorkerTrader)
|
|
|
+{
|
|
|
+ $sqlParam = array();
|
|
|
+ switch (intval($bizWorkerTrader["subsystem"])) {
|
|
|
case SUBSYS_LABOUR_MINA:
|
|
|
- $sqlParam[":biz_catalog"]=0;
|
|
|
- $sqlParam[":userid"]=$bizWorkerTrader["id"];
|
|
|
+ $sqlParam[":biz_catalog"] = 0;
|
|
|
+ $sqlParam[":userid"] = $bizWorkerTrader["id"];
|
|
|
break;
|
|
|
case SUBSYS_CAPITAL_MINA:
|
|
|
- $sqlParam[":biz_catalog"]=1;
|
|
|
- $sqlParam[":userid"]=$bizWorkerTrader["id"];
|
|
|
+ $sqlParam[":biz_catalog"] = 1;
|
|
|
+ $sqlParam[":userid"] = $bizWorkerTrader["id"];
|
|
|
break;
|
|
|
- default:throw new GeneralException("","不支持的subsystem!");
|
|
|
+ default:throw new GeneralException("", "不支持的subsystem!");
|
|
|
}
|
|
|
- $sqlTemp="";
|
|
|
- $sqlTemp.=" select *";
|
|
|
- $sqlTemp.=" ,(select content from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_content";
|
|
|
- $sqlTemp.=" ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_picurls";
|
|
|
- $sqlTemp.=" ,(select content from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_content";
|
|
|
- $sqlTemp.=" ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_picurls";
|
|
|
- $sqlTemp.=" from biz_interaction ita";
|
|
|
- $sqlTemp.=" where ita.biz_catalog=:biz_catalog and ita.fromerid=:userid";
|
|
|
- $sqlTemp.=" order by ita.id desc ";
|
|
|
- $sqlTemp.=" limit 1 ";
|
|
|
- $lastdata = pdo_fetch($sqlTemp, $sqlParam);
|
|
|
- return $lastdata;
|
|
|
+ $sqlTemp = "";
|
|
|
+ $sqlTemp .= " select *";
|
|
|
+ $sqlTemp .= " ,(select content from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_content";
|
|
|
+ $sqlTemp .= " ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_picurls";
|
|
|
+ $sqlTemp .= " ,(select content from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_content";
|
|
|
+ $sqlTemp .= " ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_picurls";
|
|
|
+ $sqlTemp .= " from biz_interaction ita";
|
|
|
+ $sqlTemp .= " where ita.biz_catalog=:biz_catalog and ita.fromerid=:userid";
|
|
|
+ $sqlTemp .= " order by ita.id desc ";
|
|
|
+ $sqlTemp .= " limit 1 ";
|
|
|
+ $lastdata = pdo_fetch($sqlTemp, $sqlParam);
|
|
|
+ return $lastdata;
|
|
|
}
|
|
|
-function bizbase_interactionAboutQuery($subSystem, $baseUser, $bizUser,$handleMode,$pageIndex,$pageSize,$ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL2_MINA) $bizTrader2 = $bizUser;
|
|
|
- switch($handleMode){
|
|
|
+function bizbase_interactionAboutQuery($subSystem, $baseUser, $bizUser, $handleMode, $pageIndex, $pageSize, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL2_MINA) {
|
|
|
+ $bizTrader2 = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($handleMode) {
|
|
|
case "fetchallSuggestion":
|
|
|
case "fetchallComplaint":
|
|
|
- $sqlParam=array();
|
|
|
+ $sqlParam = array();
|
|
|
$query = isset($ajaxdata["query"]) ? $ajaxdata["query"] : $GPC["query"];
|
|
|
- if (empty($query) && !is_array($query)){//验证一下query信息集
|
|
|
- $query=" and 1=1 ";
|
|
|
- }else{
|
|
|
- $queryNew=" and 1=1 ";
|
|
|
- foreach($query as $fdName=>$fdValue){
|
|
|
- if(empty($fdName) || empty($fdValue)) continue;
|
|
|
- switch($fdName){
|
|
|
- case "catalog":
|
|
|
- switch(intval($fdValue)){
|
|
|
+ if (empty($query) && !is_array($query)) { //验证一下query信息集
|
|
|
+ $query = " and 1=1 ";
|
|
|
+ } else {
|
|
|
+ $queryNew = " and 1=1 ";
|
|
|
+ foreach ($query as $fdName => $fdValue) {
|
|
|
+ if (empty($fdName) || empty($fdValue)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($fdName) {
|
|
|
+ case "catalog":
|
|
|
+ switch (intval($fdValue)) {
|
|
|
case 1:
|
|
|
- $queryNew .=" and ita.`status`<3 ";
|
|
|
+ $queryNew .= " and ita.`status`<3 ";
|
|
|
break;
|
|
|
case 2:
|
|
|
- $queryNew .=" and ita.`status`>=3 ";
|
|
|
+ $queryNew .= " and ita.`status`>=3 ";
|
|
|
break;
|
|
|
- }
|
|
|
- break;
|
|
|
- case "memberName":
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "memberName":
|
|
|
$paramName = ":qy_memberName";
|
|
|
- $queryNew .=" and (wk.true_name like concat('%',{$paramName},'%') or wk.nickname like concat('%',{$paramName},'%')) ";
|
|
|
+ $queryNew .= " and (wk.true_name like concat('%',{$paramName},'%') or wk.nickname like concat('%',{$paramName},'%')) ";
|
|
|
$sqlParam[$paramName] = $fdValue;
|
|
|
- break;
|
|
|
- case "traderName":
|
|
|
+ break;
|
|
|
+ case "traderName":
|
|
|
$paramName = ":qy_traderName";
|
|
|
- $queryNew .=" and (bt.company_name like concat('%',{$paramName},'%')) ";
|
|
|
+ $queryNew .= " and (bt.company_name like concat('%',{$paramName},'%')) ";
|
|
|
$sqlParam[$paramName] = $fdValue;
|
|
|
break;
|
|
|
case "biz_catalog":
|
|
|
- $queryNew .=" and ita.`biz_catalog` =".(int)$fdValue;
|
|
|
+ $queryNew .= " and ita.`biz_catalog` =" . (int) $fdValue;
|
|
|
break;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
- $query=$queryNew;
|
|
|
- }
|
|
|
- if(!empty($bizWorker)){
|
|
|
+ $query = $queryNew;
|
|
|
+ }
|
|
|
+ if (!empty($bizWorker)) {
|
|
|
$query .= " and ita.fromerid=" . intval($bizWorker["id"]) . " ";
|
|
|
- }
|
|
|
- if(!empty($bizTrader)){
|
|
|
+ }
|
|
|
+ if (!empty($bizTrader)) {
|
|
|
$query .= " and ita.fromerid=" . intval($bizTrader["id"]) . " ";
|
|
|
- }
|
|
|
- switch($handleMode){
|
|
|
+ }
|
|
|
+ switch ($handleMode) {
|
|
|
case "fetchallSuggestion":
|
|
|
$query .= " and ita.biz_catalog<2 ";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case "fetchallComplaint":
|
|
|
|
|
|
$query .= " and ita.biz_catalog>=2 ";
|
|
|
- break;
|
|
|
- }
|
|
|
+ break;
|
|
|
+ }
|
|
|
$orderby = isset($ajaxdata["orderby"]) ? $ajaxdata["orderby"] : $GPC["orderby"];
|
|
|
- switch(intval($orderby)){
|
|
|
- default://创建时间倒序
|
|
|
- $orderby=" order by ita.id desc ";
|
|
|
+ switch (intval($orderby)) {
|
|
|
+ default: //创建时间倒序
|
|
|
+ $orderby = " order by ita.id desc ";
|
|
|
break;
|
|
|
- }
|
|
|
- $sqlBody="";
|
|
|
- $sqlBody.=" from biz_interaction ita ";
|
|
|
- $sqlBody.=" left join biz_worker wk on wk.id=ita.fromerid ";
|
|
|
- $sqlBody.=" left join base_user wkbu on wkbu.id=wk.base_userid ";
|
|
|
- $sqlBody.=" left join biz_trader bt0 on bt0.id=ita.fromerid ";
|
|
|
- $sqlBody.=" left join base_user btbu0 on btbu0.id=bt0.base_userid ";
|
|
|
- $sqlBody.=" left join biz_trader bt on ita.biz_catalog>=2 and bt.id=ita.objectid ";
|
|
|
- $sqlBody.=" left join base_user btbu on ita.biz_catalog>=2 and btbu.id=bt.base_userid ";
|
|
|
- $sqlBody.=" left join biz_todowork tdwk on ita.biz_catalog>=2 and tdwk.id=ita.biz_id";
|
|
|
- $sqlBody.=" left join biz_trader_recruit btr on ita.biz_catalog>=2 and (btr.id=tdwk.biz_recruitid or btr.id=ita.biz_id)";
|
|
|
- $sqlBody.=" where ita.`deleted`=0 ".$query;
|
|
|
+ }
|
|
|
+ $sqlBody = "";
|
|
|
+ $sqlBody .= " from biz_interaction ita ";
|
|
|
+ $sqlBody .= " left join biz_worker wk on wk.id=ita.fromerid ";
|
|
|
+ $sqlBody .= " left join base_user wkbu on wkbu.id=wk.base_userid ";
|
|
|
+ $sqlBody .= " left join biz_trader bt0 on bt0.id=ita.fromerid ";
|
|
|
+ $sqlBody .= " left join base_user btbu0 on btbu0.id=bt0.base_userid ";
|
|
|
+ $sqlBody .= " left join biz_trader bt on ita.biz_catalog>=2 and bt.id=ita.objectid ";
|
|
|
+ $sqlBody .= " left join base_user btbu on ita.biz_catalog>=2 and btbu.id=bt.base_userid ";
|
|
|
+ $sqlBody .= " left join biz_todowork tdwk on ita.biz_catalog>=2 and tdwk.id=ita.biz_id";
|
|
|
+ $sqlBody .= " left join biz_trader_recruit btr on ita.biz_catalog>=2 and (btr.id=tdwk.biz_recruitid or btr.id=ita.biz_id)";
|
|
|
+ $sqlBody .= " where ita.`deleted`=0 " . $query;
|
|
|
//查询sql及统计sql
|
|
|
- $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
- $sqlFetch =" select ita.* ";
|
|
|
- $sqlFetch.=" ,(case when wk.true_name<>'' then wk.true_name else wk.nickname end) as wk_truename,wkbu.mobile as wkbu_mobile ";
|
|
|
- $sqlFetch.=" ,bt0.company_name as bt0_truename,btbu0.mobile as btbu0_mobile ";
|
|
|
- $sqlFetch.=" ,bt.company_name as bt_truename,btbu.mobile as btbu_mobile ";
|
|
|
- $sqlFetch.=" ,btr.title as btr_title ";
|
|
|
- $sqlFetch.=" ,(select content from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_content";
|
|
|
- $sqlFetch.=" ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_picurls";
|
|
|
- $sqlFetch.=" ,(select content from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_content";
|
|
|
- $sqlFetch.=" ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_picurls";
|
|
|
- $sqlFetch.=" {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
- $pageData = pdo_fetchall($sqlFetch, $sqlParam);
|
|
|
- foreach($pageData as &$data){//数据转换/映射
|
|
|
- $data["pasttimeTips"]=bizbase_pasttimeTips($data["createtime"]);
|
|
|
- $data["createtime"]=date("Y-m-d H:i:s",$data["createtime"]);
|
|
|
- $data["finishtime"]=date("Y-m-d H:i:s",$data["finishtime"]);
|
|
|
- $data["statusName"]=bizbase_interactionStatusName($data["status"]);
|
|
|
+ $start = (intval($pageIndex) - 1) * $pageSize;
|
|
|
+ $sqlFetch = " select ita.* ";
|
|
|
+ $sqlFetch .= " ,(case when wk.true_name<>'' then wk.true_name else wk.nickname end) as wk_truename,wkbu.mobile as wkbu_mobile ";
|
|
|
+ $sqlFetch .= " ,bt0.company_name as bt0_truename,btbu0.mobile as btbu0_mobile ";
|
|
|
+ $sqlFetch .= " ,bt.company_name as bt_truename,btbu.mobile as btbu_mobile ";
|
|
|
+ $sqlFetch .= " ,btr.title as btr_title ";
|
|
|
+ $sqlFetch .= " ,(select content from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_content";
|
|
|
+ $sqlFetch .= " ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=0 order by id asc limit 1) as ask_picurls";
|
|
|
+ $sqlFetch .= " ,(select content from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_content";
|
|
|
+ $sqlFetch .= " ,(select picurls from biz_interaction_talk where parentid=ita.id and catalog=1 order by id asc limit 1) as answer_picurls";
|
|
|
+ $sqlFetch .= " {$sqlBody} {$orderby} limit {$start},{$pageSize} ";
|
|
|
+ $pageData = pdo_fetchall($sqlFetch, $sqlParam);
|
|
|
+ foreach ($pageData as &$data) { //数据转换/映射
|
|
|
+ $data["pasttimeTips"] = bizbase_pasttimeTips($data["createtime"]);
|
|
|
+ $data["createtime"] = date("Y-m-d H:i:s", $data["createtime"]);
|
|
|
+ $data["finishtime"] = date("Y-m-d H:i:s", $data["finishtime"]);
|
|
|
+ $data["statusName"] = bizbase_interactionStatusName($data["status"]);
|
|
|
unset($data["remark"]);
|
|
|
}
|
|
|
- $sqlSummary=" select count(*) as count ".$sqlBody.";";
|
|
|
- $sumData=pdo_fetch($sqlSummary,$sqlParam);
|
|
|
+ $sqlSummary = " select count(*) as count " . $sqlBody . ";";
|
|
|
+ $sumData = pdo_fetch($sqlSummary, $sqlParam);
|
|
|
return array(
|
|
|
"pageData" => $pageData,
|
|
|
"count" => intval($sumData["count"]),
|
|
|
- );
|
|
|
- break;
|
|
|
+ );
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**********************综合统计相关逻辑**************************************/
|
|
|
-function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $bizUser, $ajaxdata, $GPC){
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_LABOUR_MINA) $bizWorker = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL_MINA) $bizTrader = $bizUser;
|
|
|
- if(intval($baseUser["subsystem"])==SUBSYS_CAPITAL2_MINA) $bizTrader2 = $bizUser;
|
|
|
- switch($handleMode){
|
|
|
+function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $bizUser, $ajaxdata, $GPC)
|
|
|
+{
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_LABOUR_MINA) {
|
|
|
+ $bizWorker = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL_MINA) {
|
|
|
+ $bizTrader = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (intval($baseUser["subsystem"]) == SUBSYS_CAPITAL2_MINA) {
|
|
|
+ $bizTrader2 = $bizUser;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch ($handleMode) {
|
|
|
case "fetchUndoList":
|
|
|
- $backdata=bizPlater_undoList();
|
|
|
+ $backdata = bizPlater_undoList();
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
- case "fetchallByPlater":
|
|
|
+ break;
|
|
|
+ case "fetchallByPlater":
|
|
|
case "fetchmoneyByPlater":
|
|
|
case "fetchmemberByPlater":
|
|
|
$qstartDate = isset($ajaxdata["startDate"]) ? $ajaxdata["startDate"] : $GPC["startDate"];
|
|
|
$qendDate = isset($ajaxdata["endDate"]) ? $ajaxdata["endDate"] : $GPC["endDate"];
|
|
|
- $qstartDate=strtotime($qstartDate);
|
|
|
- $qendDate=strtotime($qendDate);
|
|
|
- $qendDate=$qendDate>0?$qendDate:39506057756;
|
|
|
+ $qstartDate = strtotime($qstartDate);
|
|
|
+ $qendDate = strtotime($qendDate);
|
|
|
+ $qendDate = $qendDate > 0 ? $qendDate : 39506057756;
|
|
|
//-------------------------------------------------
|
|
|
- $monthFirstDate = strtotime(date("Y-m-01",time()));
|
|
|
- $monthLastDate = strtotime("+1 month -1 day",$monthFirstDate);
|
|
|
- $todayStart = strtotime(date("Y-m-d",time()));
|
|
|
- $todayFinish = strtotime(date("Y-m-d 23:59:59",time()));
|
|
|
- $yestodayStart =strtotime("-1 day",strtotime(date("Y-m-d",time())));
|
|
|
- $yestodayFinish = strtotime(date("Y-m-d 23:59:59",$yestodayStart));
|
|
|
- $backdata=array();
|
|
|
+ $monthFirstDate = strtotime(date("Y-m-01", time()));
|
|
|
+ $monthLastDate = strtotime("+1 month -1 day", $monthFirstDate);
|
|
|
+ $todayStart = strtotime(date("Y-m-d", time()));
|
|
|
+ $todayFinish = strtotime(date("Y-m-d 23:59:59", time()));
|
|
|
+ $yestodayStart = strtotime("-1 day", strtotime(date("Y-m-d", time())));
|
|
|
+ $yestodayFinish = strtotime(date("Y-m-d 23:59:59", $yestodayStart));
|
|
|
+ $backdata = array();
|
|
|
if ($handleMode != "fetchmoneyByPlater") {
|
|
|
- $backdata["trader_total"]=pdo_fetchcolumn("select count(*) from biz_trader where deleted=0;");
|
|
|
- $backdata["worker_total"]=pdo_fetchcolumn("select count(*) from biz_worker where deleted=0;");
|
|
|
- $backdata["worker_trace_total"]=pdo_fetchcolumn("select ifnull(count(*),0) from biz_worker_trace where deleted=0;");
|
|
|
- $backdata["worker_month_total"]=pdo_fetchcolumn("select count(*) from biz_worker
|
|
|
- where deleted=0 and createtime>=:month1 and createtime<=:month2",array(
|
|
|
- ":month1"=>$monthFirstDate,
|
|
|
- ":month2"=>$monthLastDate,
|
|
|
+ $backdata["trader_total"] = pdo_fetchcolumn("select count(*) from biz_trader where deleted=0;");
|
|
|
+ $backdata["worker_total"] = pdo_fetchcolumn("select count(*) from biz_worker where deleted=0;");
|
|
|
+ $backdata["worker_trace_total"] = pdo_fetchcolumn("select ifnull(count(*),0) from biz_worker_trace where deleted=0;");
|
|
|
+ $backdata["worker_month_total"] = pdo_fetchcolumn("select count(*) from biz_worker
|
|
|
+ where deleted=0 and createtime>=:month1 and createtime<=:month2", array(
|
|
|
+ ":month1" => $monthFirstDate,
|
|
|
+ ":month2" => $monthLastDate,
|
|
|
+ ));
|
|
|
+ $backdata["worker_today_total"] = pdo_fetchcolumn("select count(*) from biz_worker
|
|
|
+ where deleted=0 and createtime>=:today1 and createtime<=:today2", array(
|
|
|
+ ":today1" => $todayStart,
|
|
|
+ ":today2" => $todayFinish,
|
|
|
+ ));
|
|
|
+ //商家注册数
|
|
|
+ $backdata["trader_total_query"] = pdo_fetchcolumn("select count(*) from biz_trader
|
|
|
+ where deleted=0 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //会员注册数
|
|
|
+ $backdata["worker_total_query"] = pdo_fetchcolumn("select count(*) from biz_worker
|
|
|
+ where deleted=0 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //商家发布招聘数
|
|
|
+ $backdata["recruit_total_query1"] = pdo_fetchcolumn("select count(*) from biz_trader_recruit
|
|
|
+ where deleted=0 and `status`>=0 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //平台通过招聘数
|
|
|
+ $backdata["recruit_total_query2"] = pdo_fetchcolumn("select count(*) from biz_trader_recruit
|
|
|
+ where deleted=0 and `status`>=2 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //共计需求人数
|
|
|
+ $backdata["need_total_query"] = pdo_fetchcolumn("select sum(need_total) from biz_trader_recruit
|
|
|
+ where deleted=0 and `status`>=0 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //商家不录用人数
|
|
|
+ $backdata["wkrefuse_total_query"] = pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
+ where deleted=0 and `status`=-1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //用户报名数
|
|
|
+ $backdata["wkenroll_total_query"] = pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
+ where deleted=0 and `status`>=0 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //用户录用数
|
|
|
+ $backdata["wkpass_total_query"] = pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
+ where deleted=0 and `status`>=2 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //异常订单数
|
|
|
+ $backdata["wkexcept_total_query"] = pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
+ where deleted=0 and `status`<0 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //完结数
|
|
|
+ $backdata["wkfinish_total_query"] = pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
+ where deleted=0 and `status`=5 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+ if ($handleMode != "fetchmoneyByPlater") { //--------moneyAbout-----------------------------
|
|
|
+ $backdata["number_income_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_numaccount
|
|
|
+ where deleted=0 and `type`=0 and biz_catalog=0 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //平台活动总收入
|
|
|
+ $backdata["activity_income_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
+ where deleted=0 and `type`=1 and biz_catalog=1 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ $backdata["work_income_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
+ where deleted=9 and `type`=1 and biz_catalog>=1 and biz_catalog<=3 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ //share_outgo_total_query
|
|
|
+ $backdata["share_outgo_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
+ where deleted=9 and `type`=1 and biz_catalog=2 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ $backdata["salary_outgo_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
+ where deleted=9 and `type`=1 and biz_catalog=3 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+ $backdata["plat_agentpay_total_query"] = round(pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
+ where deleted=0 and `type`=1 and biz_catalog=7 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ )), 2);
|
|
|
+ $backdata["plat_workincome_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
+ where deleted=9 and `type`=1 and biz_catalog=1 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+
|
|
|
+ $backdata["worker_income_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
+ where deleted=0 and `type`=0 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
));
|
|
|
- $backdata["worker_today_total"]=pdo_fetchcolumn("select count(*) from biz_worker
|
|
|
- where deleted=0 and createtime>=:today1 and createtime<=:today2",array(
|
|
|
- ":today1"=>$todayStart,
|
|
|
- ":today2"=>$todayFinish,
|
|
|
- ));
|
|
|
- $backdata["trader_total_query"]=pdo_fetchcolumn("select count(*) from biz_trader
|
|
|
- where deleted=0 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["worker_total_query"]=pdo_fetchcolumn("select count(*) from biz_worker
|
|
|
- where deleted=0 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
-
|
|
|
- $backdata["recruit_total_query1"]=pdo_fetchcolumn("select count(*) from biz_trader_recruit
|
|
|
- where deleted=0 and `status`>=0 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["recruit_total_query2"]=pdo_fetchcolumn("select count(*) from biz_trader_recruit
|
|
|
- where deleted=0 and `status`>=2 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["need_total_query"]=pdo_fetchcolumn("select sum(need_total) from biz_trader_recruit
|
|
|
- where deleted=0 and `status`>=0 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
+ $backdata["worker_outgo_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
+ where deleted=0 and `type`=1 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
));
|
|
|
- $backdata["wkrefuse_total_query"]=pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
- where deleted=0 and `status`=-1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["wkenroll_total_query"]=pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
- where deleted=0 and `status`>=0 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["wkpass_total_query"]=pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
- where deleted=0 and `status`>=2 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["wkexcept_total_query"]=pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
- where deleted=0 and `status`<0 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["wkfinish_total_query"]=pdo_fetchcolumn("select count(*) from biz_todowork
|
|
|
- where deleted=0 and `status`=5 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- }
|
|
|
- if ($handleMode != "fetchmoneyByPlater") {//--------moneyAbout-----------------------------
|
|
|
- $backdata["number_income_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_numaccount
|
|
|
- where deleted=0 and `type`=0 and biz_catalog=0 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["activity_income_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
- where deleted=0 and `type`=1 and biz_catalog=1 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["work_income_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
- where deleted=9 and `type`=1 and biz_catalog>=1 and biz_catalog<=3 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["share_outgo_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
- where deleted=9 and `type`=1 and biz_catalog=2 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["salary_outgo_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
- where deleted=9 and `type`=1 and biz_catalog=3 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["plat_agentpay_total_query"]=round(pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
- where deleted=0 and `type`=1 and biz_catalog=7 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- )),2);
|
|
|
- $backdata["plat_workincome_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_trader_account
|
|
|
- where deleted=9 and `type`=1 and biz_catalog=1 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
-
|
|
|
- $backdata["worker_income_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
- where deleted=0 and `type`=0 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["worker_outgo_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
- where deleted=0 and `type`=1 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
- $backdata["worker_balance_total_query"]=round(floatval($backdata["worker_income_total_query"])-floatval($backdata["worker_outgo_total_query"]),2);
|
|
|
- $backdata["worker_withdraw_total_query"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
- where deleted=0 and `type`=1 and biz_catalog=0 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- ));
|
|
|
-
|
|
|
- $backdata["worker_income_total"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
- where deleted=0 and `type`=0 and `status`>=1",array());
|
|
|
- $backdata["worker_outgo_total"]=pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
- where deleted=0 and `type`=1 and `status`>=1 ",array());
|
|
|
- $backdata["worker_balance_total"]=round(floatval($backdata["worker_income_total"])-floatval($backdata["worker_outgo_total"]),2);
|
|
|
-
|
|
|
- $backdata["trader_debt2plat_total_query"]=round(pdo_fetchcolumn("select
|
|
|
- ifnull(sum(case when debt>0 then debt else 0 end),0) as debt from
|
|
|
- (select ifnull(sum(case when `type`=1 then money when `type`=0 then -money else 0 end),0) as debt from biz_trader_account
|
|
|
+ $backdata["worker_balance_total_query"] = round(floatval($backdata["worker_income_total_query"]) - floatval($backdata["worker_outgo_total_query"]), 2);
|
|
|
+ //所有用户已提现总额
|
|
|
+ $backdata["worker_withdraw_total_query"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
+ where deleted=0 and `type`=1 and biz_catalog=0 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ ));
|
|
|
+
|
|
|
+ $backdata["worker_income_total"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
+ where deleted=0 and `type`=0 and `status`>=1", array());
|
|
|
+ $backdata["worker_outgo_total"] = pdo_fetchcolumn("select ifnull(sum(money),0) from biz_worker_account
|
|
|
+ where deleted=0 and `type`=1 and `status`>=1 ", array());
|
|
|
+ $backdata["worker_balance_total"] = round(floatval($backdata["worker_income_total"]) - floatval($backdata["worker_outgo_total"]), 2);
|
|
|
+
|
|
|
+ $backdata["trader_debt2plat_total_query"] = round(pdo_fetchcolumn("select
|
|
|
+ ifnull(sum(case when debt>0 then debt else 0 end),0) as debt from
|
|
|
+ (select ifnull(sum(case when `type`=1 then money when `type`=0 then -money else 0 end),0) as debt from biz_trader_account
|
|
|
where deleted=0 and `status`>=1 and biz_roletype=0 and createtime>=:qstartDate and createtime<=:qendDate
|
|
|
group by biz_traderid) as temp
|
|
|
- ",array(
|
|
|
- ":qstartDate"=>$qstartDate,
|
|
|
- ":qendDate"=>$qendDate,
|
|
|
- )),2);
|
|
|
- $backdata["plat_income_total_query"]=round($backdata["plat_workincome_total_query"]+$backdata["number_income_total_query"]+$backdata["activity_income_total_query"],2);
|
|
|
- $backdata["plat_outgo_total_query"]=$backdata["trader_debt2plat_total_query"];
|
|
|
- $backdata["plat_balance_total_query"]=round($backdata["plat_income_total_query"]-$backdata["plat_outgo_total_query"],2);
|
|
|
- }
|
|
|
-
|
|
|
- if($handleMode == "fetchallByPlater"){
|
|
|
- $outSql=" select sum(ifnull(money,0)) as total";
|
|
|
- $outSql.=" from biz_trader_account ";
|
|
|
- $outSql.=" where biz_roletype = 0 and type = 1 and deleted = 0 and status= 1 and biz_catalog=8";
|
|
|
- $shopOutlist = pdo_fetchall($outSql, array()); //冻结工单费用
|
|
|
-
|
|
|
+ ", array(
|
|
|
+ ":qstartDate" => $qstartDate,
|
|
|
+ ":qendDate" => $qendDate,
|
|
|
+ )), 2);
|
|
|
+ $backdata["plat_income_total_query"] = round($backdata["plat_workincome_total_query"] + $backdata["number_income_total_query"] + $backdata["activity_income_total_query"], 2);
|
|
|
+ $backdata["plat_outgo_total_query"] = $backdata["trader_debt2plat_total_query"];
|
|
|
+ //平台可支出余额
|
|
|
+ $backdata["plat_balance_total_query"] = round($backdata["plat_income_total_query"] - $backdata["plat_outgo_total_query"], 2);
|
|
|
+ }
|
|
|
|
|
|
- $frozenSql=" select sum(ifnull(money,0)) as total ";
|
|
|
- $frozenSql.=" from biz_trader_account ";
|
|
|
- $frozenSql.=" where biz_roletype = 0 and type = 0 and deleted=0 and status=1 and biz_catalog = 6";
|
|
|
- $shopFrozenIn = pdo_fetchall($frozenSql, array());//工单费用解冻
|
|
|
- $shopFrozenBalance=round(floatval($shopOutlist[0]["total"]), 2)-round(floatval($shopFrozenIn[0]["total"]), 2);//商户冻结余额,即当前实际冻结的金额
|
|
|
+ if ($handleMode == "fetchallByPlater") {
|
|
|
+ $outSql = " select sum(ifnull(money,0)) as total";
|
|
|
+ $outSql .= " from biz_trader_account ";
|
|
|
+ $outSql .= " where biz_roletype = 0 and type = 1 and deleted = 0 and status= 1 and biz_catalog=8";
|
|
|
+ $shopOutlist = pdo_fetchall($outSql, array()); //冻结工单费用
|
|
|
|
|
|
+ $frozenSql = " select sum(ifnull(money,0)) as total ";
|
|
|
+ $frozenSql .= " from biz_trader_account ";
|
|
|
+ $frozenSql .= " where biz_roletype = 0 and type = 0 and deleted=0 and status=1 and biz_catalog = 6";
|
|
|
+ $shopFrozenIn = pdo_fetchall($frozenSql, array()); //工单费用解冻
|
|
|
+ $shopFrozenBalance = round(floatval($shopOutlist[0]["total"]), 2) - round(floatval($shopFrozenIn[0]["total"]), 2); //商户冻结余额,即当前实际冻结的金额
|
|
|
|
|
|
- $userOut=" select sum(ifnull(money,0)) as total ";
|
|
|
- $userOut.=" from biz_worker_account ";
|
|
|
- $userOut.=" where deleted=0 and `status`=1 and type=0";
|
|
|
+ /*
|
|
|
+ //type=0 收入
|
|
|
+ $userOut = " select sum(ifnull(money,0)) as total ";
|
|
|
+ $userOut .= " from biz_worker_account ";
|
|
|
+ $userOut .= " where deleted=0 and `status`=1 and type=0";
|
|
|
$userOutList = pdo_fetchall($userOut, array());
|
|
|
|
|
|
- $userFrozenSql =" select sum(ifnull(money,0)) as total ";
|
|
|
- $userFrozenSql.=" from biz_worker_account ";
|
|
|
- $userFrozenSql.=" where deleted=0 and `status`=1 and type=1";
|
|
|
+ //type=1 支出
|
|
|
+ $userFrozenSql = " select sum(ifnull(money,0)) as total ";
|
|
|
+ $userFrozenSql .= " from biz_worker_account ";
|
|
|
+ $userFrozenSql .= " where deleted=0 and `status`=1 and type=1";
|
|
|
$userFrozenIn = pdo_fetchall($userFrozenSql, array());
|
|
|
- $userFrozenBalance=round(floatval($userOutList[0]["total"]), 2)-round(floatval($userFrozenIn[0]["total"]), 2);//用户冻结余额,即当前实际冻结的金额
|
|
|
+ */
|
|
|
|
|
|
-// 商户总共支付会员---总金额
|
|
|
- $sumSql ="select sum(ifnull(money,0)) as total from biz_trader_account where (deleted=9 or deleted=0) and `status`=1 and type=1 and biz_catalog = 3";
|
|
|
+ //type=0 收入
|
|
|
+ $userFrozenSql = " select sum(ifnull(money,0)) as total ";
|
|
|
+ $userFrozenSql .= " from biz_worker_account ";
|
|
|
+ $userFrozenSql .= " where deleted=0 and `status`=1 and type=0 and biz_catalog=7";
|
|
|
+ $userFrozenIn = pdo_fetchall($userFrozenSql, array());
|
|
|
+
|
|
|
+ //type=1 支出
|
|
|
+ $userOut = " select sum(ifnull(money,0)) as total ";
|
|
|
+ $userOut .= " from biz_worker_account ";
|
|
|
+ $userOut .= " where deleted=0 and `status`=1 and type=1 and biz_catalog=2";
|
|
|
+ $userOutList = pdo_fetchall($userOut, array());
|
|
|
+
|
|
|
+ $userFrozenBalance = round(floatval($userOutList[0]["total"]), 2) - round(floatval($userFrozenIn[0]["total"]), 2); //用户冻结余额,即当前实际冻结的金额
|
|
|
+ // 商户总共支付会员---总金额
|
|
|
+ $sumSql = "select sum(ifnull(money,0)) as total from biz_trader_account where (deleted=9 or deleted=0) and `status`=1 and type=1 and biz_catalog = 3";
|
|
|
$sumPay = pdo_fetchall($sumSql, array());
|
|
|
$sumPay = round(floatval($sumPay[0]["total"]), 2);
|
|
|
|
|
|
-
|
|
|
// 平台收益
|
|
|
+ /*
|
|
|
$adminSql =" select sum(ifnull(money,0)) as total ";
|
|
|
$adminSql.=" from biz_worker_account ";
|
|
|
$adminSql.=" where (deleted=9 or deleted=0) and `status`=1 and type=1 and biz_catalog = 1";
|
|
|
$adminSql = pdo_fetchall($adminSql, array());
|
|
|
$adminSum = round(floatval($adminSql[0]["total"]), 2);
|
|
|
-
|
|
|
-
|
|
|
+ */
|
|
|
+ $adminSql = " select sum(ifnull(money,0)) as total ";
|
|
|
+ $adminSql .= " from biz_worker_account ";
|
|
|
+ $adminSql .= " where (deleted=9 or deleted=0) and `status`=1 and type=1 and biz_catalog = 1";
|
|
|
+ $adminSql = pdo_fetchall($adminSql, array());
|
|
|
+ $adminSum1 = round(floatval($adminSql[0]["total"]), 2);
|
|
|
+ $adminSql = " select sum(ifnull(money,0)) as total ";
|
|
|
+ $adminSql .= " from biz_trader_account ";
|
|
|
+ $adminSql .= " where (deleted=9 or deleted=0) and `status`=1 and type=1 and biz_catalog = 1";
|
|
|
+ $adminSql = pdo_fetchall($adminSql, array());
|
|
|
+ $adminSum2 = round(floatval($adminSql[0]["total"]), 2);
|
|
|
|
|
|
// 未提现金额:所有会员&商家的账户余额(即待提现金额)的总和
|
|
|
- $shop_sum_sql =" select type,money as total ";
|
|
|
- $shop_sum_sql.=" from biz_trader_account ";
|
|
|
- $shop_sum_sql.=" where biz_roletype=0 and `deleted`=0 and `status`=1";
|
|
|
+ //商铺
|
|
|
+ /*$shop_sum_sql = " select type,money as total ";
|
|
|
+ $shop_sum_sql .= " from biz_trader_account ";
|
|
|
+ $shop_sum_sql .= " where biz_roletype=0 and `deleted`=0 and `status`=1";
|
|
|
$totalList = pdo_fetchall($shop_sum_sql, array());
|
|
|
- $income=0.0;
|
|
|
- $outgoing=0.0;
|
|
|
- foreach($totalList as $item){
|
|
|
- switch(intval($item["type"])){
|
|
|
- case 0://收入
|
|
|
- $income += round(floatval($item["total"]), 2);
|
|
|
- break;
|
|
|
- case 1://支出
|
|
|
- $outgoing += round(floatval($item["total"]), 2);
|
|
|
- break;
|
|
|
- }
|
|
|
+ $income = 0.0;
|
|
|
+ $outgoing = 0.0;
|
|
|
+ foreach ($totalList as $item) {
|
|
|
+ switch (intval($item["type"])) {
|
|
|
+ case 0: //收入
|
|
|
+ $income += round(floatval($item["total"]), 2);
|
|
|
+ break;
|
|
|
+ case 1: //支出
|
|
|
+ $outgoing += round(floatval($item["total"]), 2);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- $shopBalance = round(floatval($income - $outgoing),2);
|
|
|
+ $shopBalance = round(floatval($income - $outgoing), 2);*/
|
|
|
+ $shop_sum_in_sql = "select sum(ifnull(money,0)) as total from biz_trader_account
|
|
|
+ where biz_roletype=0 and type=0 and `deleted`=0 and `status`=1 and biz_catalog in (0,1,2,3,6)";
|
|
|
+ $shopsumin = pdo_fetchall($shop_sum_in_sql, array());
|
|
|
|
|
|
- $user_sum_sql =" select type,money as total ";
|
|
|
- $user_sum_sql.=" from biz_worker_account ";
|
|
|
- $user_sum_sql.=" where deleted=0 and `status`=1 ";
|
|
|
+ $shop_sum_out_sql = "select sum(ifnull(money,0)) as total from biz_trader_account
|
|
|
+ where biz_roletype=0 and type=1 and `deleted`=0 and `status`=1 and biz_catalog in (0,1,2,3,4,5,6,7,8)";
|
|
|
+ $shopsumout = pdo_fetchall($shop_sum_out_sql, array());
|
|
|
+ $shopBalance = bcsub(floatval($shopsumin[0]['total']), floatval($shopsumout[0]['total']), 2);
|
|
|
+ //用户
|
|
|
+ /*$user_sum_sql = " select type,money as total ";
|
|
|
+ $user_sum_sql .= " from biz_worker_account ";
|
|
|
+ $user_sum_sql .= " where deleted=0 and `status`=1 ";
|
|
|
$totalList = pdo_fetchall($user_sum_sql, array());
|
|
|
- $user_income=0.0;
|
|
|
- $user_outgoing=0.0;
|
|
|
- foreach($totalList as $item){
|
|
|
- switch(intval($item["type"])){
|
|
|
- case 0://收入
|
|
|
- $user_income += round(floatval($item["total"]), 2);
|
|
|
- break;
|
|
|
- case 1://支出
|
|
|
- $user_outgoing = round(floatval($item["total"]), 2);
|
|
|
- break;
|
|
|
- }
|
|
|
+ $user_income = 0.0;
|
|
|
+ $user_outgoing = 0.0;
|
|
|
+ foreach ($totalList as $item) {
|
|
|
+ switch (intval($item["type"])) {
|
|
|
+ case 0: //收入
|
|
|
+ $user_income += round(floatval($item["total"]), 2);
|
|
|
+ break;
|
|
|
+ case 1: //支出
|
|
|
+ $user_outgoing = round(floatval($item["total"]), 2);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- $userBalance = round($user_income - $user_outgoing,2);
|
|
|
- $sum = $shopBalance + $userBalance;
|
|
|
+ $userBalance = round($user_income - $user_outgoing, 2);
|
|
|
+ */
|
|
|
+ $user_sum_in_sql = "select sum(ifnull(money,0)) as total from biz_worker_account
|
|
|
+ where deleted=0 and `status`=1 and type=0 and biz_catalog in (0,1,2,3,4,7)";
|
|
|
+ $usersumin = pdo_fetchall($user_sum_in_sql, array());
|
|
|
+ $user_sum_out_sql = "select sum(ifnull(money,0)) as total from biz_worker_account
|
|
|
+ where deleted=0 and `status`=1 and type=1 and biz_catalog in (0,1,2)";
|
|
|
+ $usersumout = pdo_fetchall($user_sum_out_sql, array());
|
|
|
+ $userBalance = bcsub(floatval($usersumin[0]['total']), floatval($usersumout[0]['total']), 2);
|
|
|
+ $sum = bcadd($shopBalance, $userBalance, 2);
|
|
|
|
|
|
$newSum = [
|
|
|
- 'shopFrozenBalance'=>round($shopFrozenBalance,2) ,
|
|
|
- 'userFrozenBalance'=>round($userFrozenBalance,2) ,
|
|
|
- 'sumPay'=>round($sumPay,2) ,
|
|
|
- 'adminSum'=>round($adminSum,2) ,
|
|
|
- 'remaining_sum'=> round($sum,2)
|
|
|
+ //商户冻结总金额
|
|
|
+ 'shopFrozenBalance' => round($shopFrozenBalance, 2),
|
|
|
+ //会员冻结总金额
|
|
|
+ 'userFrozenBalance' => round($userFrozenBalance, 2),
|
|
|
+ //商户累计支付会员工资
|
|
|
+ 'sumPay' => round($sumPay, 2),
|
|
|
+ //平台兼职总收入
|
|
|
+ //'adminSum' => round($adminSum+, 2),
|
|
|
+ 'adminSum' => bcadd($adminSum1, $adminSum2, 2),
|
|
|
+ //所有用户待提现总额
|
|
|
+ 'remaining_sum' => round($sum, 2),
|
|
|
];
|
|
|
$backdata['newSum'] = $newSum;
|
|
|
}
|
|
|
return $backdata;
|
|
|
- break;
|
|
|
+ break;
|
|
|
default:
|
|
|
- throw new GeneralException("","不支持的handleMode!");
|
|
|
- }
|
|
|
-}
|
|
|
+ throw new GeneralException("", "不支持的handleMode!");
|
|
|
+ }
|
|
|
+}
|