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