|
@@ -563,11 +563,12 @@ function bizbase_accountEntityHandle($subSystem, $baseUser, $bizUser, $handleMod
|
|
|
$sqlParam[":wxmina_openid"] = $wxmina_openid;
|
|
|
$sqlParam[":money"] = $money;
|
|
|
$sqlParam[":prefix"] = "TX" . date("YmdHis", time()) . "ID";
|
|
|
+ $sqlParam[":remark"] = "[" . date("Y-m-d H:i:s", time()) . "] 用户提现 \n";
|
|
|
$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 .= " ,wxmina_appid=:wxmina_appid, wxmina_openid=:wxmina_openid ,remark=:remark; ";
|
|
|
$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);
|
|
@@ -631,12 +632,13 @@ function bizbase_accountEntityHandle($subSystem, $baseUser, $bizUser, $handleMod
|
|
|
$sqlParam[":wxmina_openid"] = $wxmina_openid;
|
|
|
$sqlParam[":money"] = $money;
|
|
|
$sqlParam[":prefix"] = "TXT" . date("YmdHis", time()) . "ID";
|
|
|
+ $sqlParam[":remark"] = "[" . date("Y-m-d H:i:s", time()) . "] 商户提现 \n";
|
|
|
$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 .= " ,wxmina_appid=:wxmina_appid, wxmina_openid=:wxmina_openid,remark=:remark; ";
|
|
|
$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);
|
|
@@ -2113,12 +2115,19 @@ function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $biz
|
|
|
":qstartDate" => $qstartDate,
|
|
|
":qendDate" => $qendDate,
|
|
|
));
|
|
|
- //平台活动总收入
|
|
|
+ //平台活动总收入 biz_catalog=10 用户活动支出
|
|
|
+ /*$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["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(
|
|
|
+ where deleted=0 and `type`=1 and biz_catalog=10 and `status`>=1 and createtime>=:qstartDate and createtime<=:qendDate", array(
|
|
|
":qstartDate" => $qstartDate,
|
|
|
":qendDate" => $qendDate,
|
|
|
));
|
|
|
+ //$backdata["activity_income_total_query"] = 0;
|
|
|
+
|
|
|
$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,
|
|
@@ -2168,6 +2177,7 @@ function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $biz
|
|
|
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
|
|
@@ -2182,7 +2192,8 @@ function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $biz
|
|
|
$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);
|
|
|
+ //$backdata["plat_balance_total_query"] = round($backdata["plat_income_total_query"] - $backdata["plat_outgo_total_query"], 2);
|
|
|
+ //$backdata["plat_balance_total_query"] = bcadd($backdata["activity_income_total_query"])
|
|
|
}
|
|
|
|
|
|
if ($handleMode == "fetchallByPlater") {
|
|
@@ -2214,7 +2225,7 @@ function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $biz
|
|
|
//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";
|
|
|
+ $userFrozenSql .= " where deleted=0 and `status`=1 and type=0 and biz_catalog in (7,5)";
|
|
|
$userFrozenIn = pdo_fetchall($userFrozenSql, array());
|
|
|
|
|
|
//type=1 支出
|
|
@@ -2237,14 +2248,16 @@ function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $biz
|
|
|
$adminSql = pdo_fetchall($adminSql, array());
|
|
|
$adminSum = round(floatval($adminSql[0]["total"]), 2);
|
|
|
*/
|
|
|
- $adminSql = " select sum(ifnull(money,0)) as total ";
|
|
|
+ /*$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);
|
|
|
+ $adminSum1 = round(floatval($adminSql[0]["total"]), 2);*/
|
|
|
+ $adminSum1 = 0;
|
|
|
$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 .= " where (deleted=9 ) and `status`=1 and type=1 and biz_catalog = 1";
|
|
|
+ //$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);
|
|
|
|
|
@@ -2268,7 +2281,7 @@ function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $biz
|
|
|
}
|
|
|
$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)";
|
|
|
+ where biz_roletype=0 and type=0 and `deleted`=0 and `status`=1 and biz_catalog in (0,1,2,3,6,7)";
|
|
|
$shopsumin = pdo_fetchall($shop_sum_in_sql, array());
|
|
|
|
|
|
$shop_sum_out_sql = "select sum(ifnull(money,0)) as total from biz_trader_account
|
|
@@ -2295,14 +2308,16 @@ function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $biz
|
|
|
$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)";
|
|
|
+ where deleted=0 and `status`=1 and type=0 and biz_catalog in (0,1,2,3,4,5,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)";
|
|
|
+ where deleted=0 and `status`=1 and type=1 and biz_catalog in (0,1,2,10)";
|
|
|
$usersumout = pdo_fetchall($user_sum_out_sql, array());
|
|
|
$userBalance = bcsub(floatval($usersumin[0]['total']), floatval($usersumout[0]['total']), 2);
|
|
|
$sum = bcadd($shopBalance, $userBalance, 2);
|
|
|
|
|
|
+ //平台兼职总收入
|
|
|
+ $adminSum = bcadd($adminSum1, $adminSum2, 2);
|
|
|
$newSum = [
|
|
|
//商户冻结总金额
|
|
|
'shopFrozenBalance' => round($shopFrozenBalance, 2),
|
|
@@ -2312,10 +2327,11 @@ function bizbase_statisticsEntityHandle($subSystem, $handleMode, $baseUser, $biz
|
|
|
'sumPay' => round($sumPay, 2),
|
|
|
//平台兼职总收入
|
|
|
//'adminSum' => round($adminSum+, 2),
|
|
|
- 'adminSum' => bcadd($adminSum1, $adminSum2, 2),
|
|
|
+ 'adminSum' => $adminSum,
|
|
|
//所有用户待提现总额
|
|
|
'remaining_sum' => round($sum, 2),
|
|
|
];
|
|
|
+ $backdata["plat_balance_total_query"] = bcadd($backdata["activity_income_total_query"], $adminSum, 2);
|
|
|
$backdata['newSum'] = $newSum;
|
|
|
}
|
|
|
return $backdata;
|