Browse Source

服务专员

master
Lemon 5 years ago
parent
commit
211f199067
  1. 15
      app/Model/v3/ServicePersonnel.php
  2. 3
      app/Service/v3/Implementations/ServiceEvaluateService.php

15
app/Model/v3/ServicePersonnel.php

@ -3,12 +3,20 @@
declare (strict_types=1);
namespace App\Model\v3;
use App\Constants\v3\OssThumbnail;
use App\Model\Model;
use App\Service\v3\Interfaces\AttachmentServiceInterface;
use Hyperf\Database\Model\SoftDeletes;
use Hyperf\Di\Annotation\Inject;
class ServicePersonnel extends Model
{
use SoftDeletes;
/**
* @Inject
* @var AttachmentServiceInterface
*/
protected $attachmentService;
/**
* The table associated with the model.
*
@ -21,6 +29,7 @@ class ServicePersonnel extends Model
* @var array
*/
protected $fillable = [];
/**
* The attributes that should be cast to native types.
*
@ -29,4 +38,8 @@ class ServicePersonnel extends Model
// protected $casts = [
// 'set_reward' => 'array'
// ];
public function getHeadUrlAttribute($value)
{
return $this->attachmentService->switchImgToAliOss($value, OssThumbnail::THUMBNAIL_600_Q90);
}
}

3
app/Service/v3/Implementations/ServiceEvaluateService.php

@ -3,6 +3,7 @@
namespace App\Service\v3\Implementations;
use App\Model\v3\ServiceEvaluate;
use App\Model\v3\ServicePersonnel;
use App\Model\v3\User;
use App\Service\v3\Interfaces\ServiceEvaluateServiceInterface;
use Hyperf\DbConnection\Db;
@ -47,7 +48,7 @@ class ServiceEvaluateService implements ServiceEvaluateServiceInterface
public function getPersonnelInfo($service_personnel_id)
{
$res = Db::table('lanzu_service_personnel')
$res = ServicePersonnel::query()
->where([
['id','=',$service_personnel_id],
['status','=',1]

Loading…
Cancel
Save