灵睿积分兼容无团队
This commit is contained in:
parent
850f0e1f98
commit
9e67c8f3d7
@ -17,7 +17,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Team_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-team_id" data-rule="required" data-source="score/team/index" class="form-control selectpage" name="row[team_id]" type="text" value="">
|
||||
<input id="c-team_id" data-source="score/team/index" class="form-control selectpage" name="row[team_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Team_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-team_id" data-rule="required" data-source="score/team/index" class="form-control selectpage" name="row[team_id]" type="text" value="{$row.team_id|htmlentities}">
|
||||
<input id="c-team_id" data-source="score/team/index" class="form-control selectpage" name="row[team_id]" type="text" value="{$row.team_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ class Score extends Api
|
||||
*/
|
||||
protected $model = null;
|
||||
protected $noNeedRight = ['*'];
|
||||
// protected $noNeedLogin = ['*'];
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
|
||||
@ -431,6 +431,9 @@ class Log extends BaseModel
|
||||
$my_team_score = null;
|
||||
$my_team_id = null;
|
||||
|
||||
|
||||
// var_dump($user_id);
|
||||
|
||||
foreach ($employees as $employee){
|
||||
//统计当前员工积分
|
||||
$score = self::where("score_employee_id",$employee['id'])
|
||||
@ -446,6 +449,7 @@ class Log extends BaseModel
|
||||
];
|
||||
$employee_score[$employee['id']] = $employeedata;
|
||||
if($user_id && $user_id == $employee['user_id']){
|
||||
|
||||
$my_employee_score = $employeedata;
|
||||
$my_team_id = $employee['team_id'];
|
||||
}
|
||||
@ -468,7 +472,7 @@ class Log extends BaseModel
|
||||
}
|
||||
//自己团队的积分
|
||||
if($my_team_id){
|
||||
$my_team_score = $team_score[$my_team_id];
|
||||
$my_team_score = $team_score[$my_team_id] ?? 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user