灵睿积分项类型可配置化

This commit is contained in:
jiaoyukun 2026-03-02 15:07:24 +08:00
parent 3914fd0689
commit b70b948cdd
7 changed files with 15 additions and 5 deletions

View File

@ -23,8 +23,14 @@ class Event extends Backend
parent::_initialize(); parent::_initialize();
$this->model = new \app\admin\model\score\Event; $this->model = new \app\admin\model\score\Event;
$this->view->assign("statusList", $this->model->getStatusList()); $this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign("statusListJson", json_encode($this->model->getStatusList(), JSON_UNESCAPED_UNICODE));
$this->view->assign("frequencyList", $this->model->getFrequencyList()); $this->view->assign("frequencyList", $this->model->getFrequencyList());
$this->view->assign("wayList", $this->model->getWayList()); $this->view->assign("wayList", $this->model->getWayList());
} }

View File

@ -44,7 +44,7 @@ class Event extends Model
public function getStatusList() public function getStatusList()
{ {
return ['attendance' => __('Status attendance'), 'morning_meeting_hosting' => __('Status morning_meeting_hosting'), 'safety_environment' => __('Status safety_environment'), 'appearance_demeanor' => __('Status appearance_demeanor'), 'thorough_summarization' => __('Status thorough_summarization'), 'good_people_deeds' => __('Status good_people_deeds'), 'customer_service' => __('Status customer_service'), 'corporate_culture' => __('Status corporate_culture')]; return config("site.type_point_program");
} }
public function getFrequencyList() public function getFrequencyList()

View File

@ -44,3 +44,6 @@
</div> </div>
</div> </div>
</div> </div>
<script>
var statusListJson = {$statusListJson};
</script>

View File

@ -127,7 +127,7 @@ class Score extends Api
// var_dump($this->model->getLastSql()); // var_dump($this->model->getLastSql());
}catch (\Exception $e){ }catch (\Exception $e){
$this->error($e->getMessage()); $this->error($e->getMessage().$e->getFile().$e->getLine());
} }
$this->success('查询成功', $res); $this->success('查询成功', $res);
} }

View File

@ -45,7 +45,7 @@ class Event extends BaseModel
public function getStatusList() public function getStatusList()
{ {
return ['attendance' => __('Status attendance'), 'morning_meeting_hosting' => __('Status morning_meeting_hosting'), 'safety_environment' => __('Status safety_environment'), 'appearance_demeanor' => __('Status appearance_demeanor'), 'thorough_summarization' => __('Status thorough_summarization'), 'good_people_deeds' => __('Status good_people_deeds'), 'customer_service' => __('Status customer_service'), 'corporate_culture' => __('Status corporate_culture')]; return config("site.type_point_program");
} }
public function getFrequencyList() public function getFrequencyList()

View File

@ -451,7 +451,7 @@ class Log extends BaseModel
} }
if($employee['team_id'] && $employee['team']){
if(!isset($team_score[$employee['team_id']])){ if(!isset($team_score[$employee['team_id']])){
$team_data = [ $team_data = [
'id'=>$employee['team_id'], 'id'=>$employee['team_id'],
@ -464,6 +464,7 @@ class Log extends BaseModel
//累加积分 //累加积分
$team_score[$employee['team_id']]['score'] += $score; $team_score[$employee['team_id']]['score'] += $score;
} }
}
} }
//自己团队的积分 //自己团队的积分
if($my_team_id){ if($my_team_id){

View File

@ -29,7 +29,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{checkbox: true}, {checkbox: true},
{field: 'id', title: __('Id')}, {field: 'id', title: __('Id')},
{field: 'status', title: __('Status'), searchList: {"attendance":__('Status attendance'),"morning_meeting_hosting":__('Status morning_meeting_hosting'),"safety_environment":__('Status safety_environment'),"appearance_demeanor":__('Status appearance_demeanor'),"thorough_summarization":__('Status thorough_summarization'),"good_people_deeds":__('Status good_people_deeds'),"customer_service":__('Status customer_service'),"corporate_culture":__('Status corporate_culture')}, formatter: Table.api.formatter.status}, {field: 'status', title: __('Status'), searchList: statusListJson, formatter: Table.api.formatter.status},
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'score', title: __('Score'), operate: false}, {field: 'score', title: __('Score'), operate: false},