|
|
|
@ -6,6 +6,7 @@ use App\Model\ServiceEvaluate; |
|
|
|
use Hyperf\DbConnection\Db; |
|
|
|
use Hyperf\HttpServer\Contract\RequestInterface; |
|
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
use Hyperf\Paginator\Paginator; |
|
|
|
|
|
|
|
class ServiceEvaluateService implements ServiceEvaluateServiceInterface |
|
|
|
{ |
|
|
|
@ -26,22 +27,35 @@ class ServiceEvaluateService implements ServiceEvaluateServiceInterface |
|
|
|
return ServiceEvaluate::create($data); |
|
|
|
} |
|
|
|
|
|
|
|
public function getPersonnelInfo() |
|
|
|
public function getPersonnelInfo($user_id) |
|
|
|
{ |
|
|
|
$data = $this->request->all(); |
|
|
|
$res = Db::table('lanzu_service_personnel') |
|
|
|
->where(['user_id' => $data['user_id']]) |
|
|
|
->where(['user_id' => $user_id]) |
|
|
|
->first(); |
|
|
|
return $res; |
|
|
|
} |
|
|
|
|
|
|
|
public function getEvaluateList() |
|
|
|
public function getEvaluateList($service_personnel_id) |
|
|
|
{ |
|
|
|
$data = $this->request->all(); |
|
|
|
$res = Db::table('lanzu_service_evaluate') |
|
|
|
->where(['service_personnel_id' => $data['service_personnel_id']]) |
|
|
|
->where(['service_personnel_id' => $service_personnel_id]) |
|
|
|
->limit(4) |
|
|
|
->get(); |
|
|
|
return $res; |
|
|
|
// return $res;
|
|
|
|
$currentPage = 1; |
|
|
|
$perPage = 2; |
|
|
|
|
|
|
|
// 这里根据 $currentPage 和 $perPage 进行数据查询,以下使用 Collection 代替
|
|
|
|
// $collection = new Collection([
|
|
|
|
// ['id' => 1, 'name' => 'Tom'],
|
|
|
|
// ['id' => 2, 'name' => 'Sam'],
|
|
|
|
// ['id' => 3, 'name' => 'Tim'],
|
|
|
|
// ['id' => 4, 'name' => 'Joe'],
|
|
|
|
// ]);
|
|
|
|
//
|
|
|
|
// $users = array_values($collection->forPage($currentPage, $perPage)->toArray());
|
|
|
|
|
|
|
|
return new Paginator($res, $perPage, $currentPage); |
|
|
|
} |
|
|
|
|
|
|
|
} |