| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- /**
- * 投诉建议模型
- */
- class ComplaintModel extends Model
- {
- /**
- * 表名
- */
- protected $table = 'complaint';
- /**
- * 主键
- */
- protected $primaryKey = 'id';
- /**
- * 时间戳
- */
- public $timestamps = false;
- /**
- * 可批量赋值的属性
- */
- protected $fillable = [
- 'user_id',
- 'mobile',
- 'realname',
- 'content',
- 'albums',
- 'create_time',
- 'update_time',
- 'remark',
- 'status',
- 'mark'
- ];
- /**
- * 关联用户
- */
- public function user()
- {
- return $this->belongsTo(MemberModel::class, 'user_id', 'id');
- }
- // 图
- public function getThumbAttribute($value)
- {
- $value = $value ? get_format_images($value,'url', 'array') : [];
- return $value;
- }
- }
|