Commit bc25e19e authored by luhongguang's avatar luhongguang

update: 团长分销 账单详情

parent 75bb2a35
...@@ -296,18 +296,32 @@ class PindanActivityInviteOrderService ...@@ -296,18 +296,32 @@ class PindanActivityInviteOrderService
*/ */
public static function getPayInfoList($params = []) public static function getPayInfoList($params = [])
{ {
$weekDay = date("Y-m-d", strtotime("-7 day"));
$userId = $params["user_id"]; $userId = $params["user_id"];
if (empty($userId)) { if (empty($userId)) {
return []; return [];
} }
$data = $res = [];
$nowHour = date("H");
if ($nowHour < 12) {
$todayNum = 3;
} else {
$todayNum = 2;
}
for ($i = 0; $i < $todayNum; $i++) {
$date = date("Y-m-d", strtotime("-$i day"));
$res[$date]["total"] = 0;
$res[$date]["date"] = $date;
$res[$date]["status"] = 2;
$res[$date]["data"] = [];
}
$weekDay = date("Y-m-d", strtotime("-7 day"));
$payList = ColonelDistributorPayInfo::select("*", [ $payList = ColonelDistributorPayInfo::select("*", [
"colonel_user_id" => $userId, "colonel_user_id" => $userId,
"date[>=]" => $weekDay, "date[>=]" => $weekDay,
"ORDER" => ["date" => "DESC"] "ORDER" => ["date" => "DESC"]
], []); ], []);
$data = $res = [];
if (!empty($payList)) { if (!empty($payList)) {
foreach ($payList as $item) { foreach ($payList as $item) {
$tempItem = []; $tempItem = [];
...@@ -327,6 +341,7 @@ class PindanActivityInviteOrderService ...@@ -327,6 +341,7 @@ class PindanActivityInviteOrderService
$res[$key]["total"] = $total / 100; $res[$key]["total"] = $total / 100;
$res[$key]["date"] = $key; $res[$key]["date"] = $key;
$res[$key]["status"] = 1;
$res[$key]["data"] = $item; $res[$key]["data"] = $item;
foreach ($item as $k => $v) { foreach ($item as $k => $v) {
$res[$key]["data"][$k]["reward"] = $v["reward"] / 100; $res[$key]["data"][$k]["reward"] = $v["reward"] / 100;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment