123456789101112131415161718192021222324252627282930 |
- <?php
- namespace App\Models;
- use App\Traits\ModelHelpers;
- use Illuminate\Database\Eloquent\Model;
- class Questions extends Model
- {
- use ModelHelpers;
- //
- protected $table = "questions";
- const READ_YES = 1;
- const READ_NO = 0;
- public static $readMaps = [
- self::READ_NO => '未读',
- self::READ_YES => '已读',
- ];
- public function users(){
- return $this->belongsTo(User::class,'user_id','id');
- }
- public function areas()
- {
- return $this->belongsTo(Area::class, 'area_id', 'id');
- }
- }
|