| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Apply extends Model
- {
- protected $table = 'love_user_apply';
- protected $fillable = [
- 'status', 'uid', 'tel','sex', 'name','age','occupation','school','km','file1','file2','file3','cardpros','cardcons'
- ];
- public function user(){
- return $this->hasOne(Users::class,'id','uid')->select('id','name', 'lid', 'avatar','sex','age','vip','trump','opt','city');
- }
- public function getFile1Attribute() {
- $file=$this->attributes['file1'];
- $inx = strstr($file, 'http');
- if (!$inx){
- return config('love.QINIU_MY_DOMAINS').$file;
- }
- return $file;
- }
- public function getFile2Attribute() {
- $file=$this->attributes['file2'];
- $inx = strstr($file, 'http');
- if (!$inx){
- return config('love.QINIU_MY_DOMAINS').$file;
- }
- return $file;
- }
- public function getFile3Attribute() {
- $file=$this->attributes['file3'];
- $inx = strstr($file, 'http');
- if (!$inx){
- return config('love.QINIU_MY_DOMAINS').$file;
- }
- return $file;
- }
- public function getCardprosAttribute() {
- $file=$this->attributes['cardpros'];
- $inx = strstr($file, 'http');
- if (!$inx){
- return config('love.QINIU_MY_DOMAINS').$file;
- }
- return $file;
- }
- public function getCardconsAttribute() {
- $file=$this->attributes['cardcons'];
- $inx = strstr($file, 'http');
- if (!$inx){
- return config('love.QINIU_MY_DOMAINS').$file;
- }
- return $file;
- }
- }
|