|
@@ -25,8 +25,8 @@ discard block |
|
|
block discarded – undo |
|
25
|
25
|
public function feed($uid=null) |
|
26
|
26
|
{ |
|
27
|
27
|
$ret=[]; |
|
28
|
|
- $solution=DB::table("problem_solution")->join("problem","problem.pid","=","problem_solution.pid")->where(["uid"=>$uid,"audit"=>1])->select("problem.pid as pid","pcode","title","problem_solution.created_at as created_at")->get()->all(); |
|
29
|
|
- foreach($solution as &$s){ |
|
|
28
|
+ $solution=DB::table("problem_solution")->join("problem", "problem.pid", "=", "problem_solution.pid")->where(["uid"=>$uid, "audit"=>1])->select("problem.pid as pid", "pcode", "title", "problem_solution.created_at as created_at")->get()->all(); |
|
|
29
|
+ foreach ($solution as &$s) { |
|
30
|
30
|
$s["type"]="event"; |
|
31
|
31
|
$s["color"]="wemd-orange"; |
|
32
|
32
|
$s["icon"]="comment-check-outline"; |
|
@@ -92,14 +92,14 @@ discard block |
|
|
block discarded – undo |
|
92
|
92
|
])->join("problem", "problem.pid", "=", "submission.pid")->select('pcode')->distinct()->get()->all(); |
|
93
|
93
|
$ret["solvedCount"]=count($ret["solved"]); |
|
94
|
94
|
// Casual |
|
95
|
|
- $ret["rank"]=Cache::tags(['rank',$ret["id"]])->get("rank", "N/A"); |
|
96
|
|
- $ret["rankTitle"]=Cache::tags(['rank',$ret["id"]])->get("title"); |
|
|
95
|
+ $ret["rank"]=Cache::tags(['rank', $ret["id"]])->get("rank", "N/A"); |
|
|
96
|
+ $ret["rankTitle"]=Cache::tags(['rank', $ret["id"]])->get("title"); |
|
97
|
97
|
$ret["rankTitleColor"]=RankModel::getColor($ret["rankTitle"]); |
|
98
|
98
|
// Professional |
|
99
|
99
|
$ret["professionalTitle"]=RankModel::getProfessionalTitle($ret["professional_rate"]); |
|
100
|
100
|
$ret["professionalTitleColor"]=RankModel::getProfessionalColor($ret["professionalTitle"]); |
|
101
|
101
|
// Administration Group |
|
102
|
|
- $ret["admin"]=$uid==1?1:0; |
|
|
102
|
+ $ret["admin"]=$uid==1 ? 1 : 0; |
|
103
|
103
|
if (Cache::tags(['bing', 'pic'])->get(date("Y-m-d"))==null) { |
|
104
|
104
|
$bing=new BingPhoto([ |
|
105
|
105
|
'locale' => 'zh-CN', |