sth
This commit is contained in:
parent
6106f08b6e
commit
f5d92ae1fe
|
|
@ -24,7 +24,7 @@ class UpdateWorkerManCommand extends Command
|
|||
$workers = Worker::all();
|
||||
foreach ($workers as $worker)
|
||||
{
|
||||
$avg = Review::where('worker_id',$worker->id)->avg('worker_star');
|
||||
$avg = Review::where('worker_id',$worker->id)->where('is_star',1)->avg('worker_star');
|
||||
if($avg){
|
||||
$worker->star = $avg;
|
||||
$worker->save();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user