|
|
@@ -151,7 +151,7 @@ class MasterWorkerLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|
|
*/
|
|
|
public function lists(): array
|
|
|
{
|
|
|
- $fields = ['mw.*','mwr.maintain_exp_type','mwr.other_exp_type'];
|
|
|
+ $fields = ['mw.*','mwr.maintain_exp_type','mwr.other_exp_type','mws.comprehensive_score','mws.weight_score'];
|
|
|
$orders = ['mw.id' => 'desc'];
|
|
|
$queryWhere = $this->queryWhere();
|
|
|
//dd($queryWhere,$this->searchWhere);
|
|
|
@@ -168,12 +168,14 @@ class MasterWorkerLists extends BaseAdminDataLists implements ListsSearchInterfa
|
|
|
}
|
|
|
$list = MasterWorker::alias('mw')
|
|
|
->join('master_worker_register mwr', 'mwr.worker_id = mw.id')
|
|
|
+ ->join('master_worker_score mws', 'mws.worker_id = mw.id')
|
|
|
->where($this->searchWhere)
|
|
|
->where($queryWhere)
|
|
|
->where($this->queryDataWhere())
|
|
|
->whereRaw($distanceWhereSql)
|
|
|
->field($fields)
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
+ ->orderRaw('(mws.comprehensive_score + mws.weight_score) desc')
|
|
|
->order($orders)
|
|
|
->select()->toArray();
|
|
|
$workCount = array_column(ServiceWork::where('master_worker_id','>',0)
|