12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- /**
- * Created by PhpStorm.
- * User: wuzhenke
- * Date: 2018/11/9
- * Time: 15:38
- */
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class JobsContact extends Model
- {
- protected $guarded = [''];
- public function jobs()
- {
- return $this->belongsTo(Jobs::class, 'id', 'job_id');
- }
- public function getLandlineTelAttribute($value)
- {
- if ($value) {
- return explode('-', $value);
- }
- }
- public function setLandlineTelAttribute($value)
- {
- if ($value) {
- $this->attributes['landline_tel'] = implode('-', $value);
- }
- }
- }
|