12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- /**
- * Created by PhpStorm.
- * User: vanshao
- * Date: 2019-04-17
- * Time: 09:30
- */
- namespace App\Http\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class Enquiry extends Model{
- use SoftDeletes;
- protected $table = 'enquiry';
- protected $primaryKey = 'id';
- protected $guarded=[];//批量赋值
- public function getStatusTitleAttribute(){
- switch ($this->status??0){
- case 1:
- return '未读';
- case 2:
- return '已读';
- default:
- return '';
- }
- }
- public function getTypeTitleAttribute(){
- switch ($this->type??0){
- case 1:
- return '解决方案';
- case 2:
- return '营销方案';
- case 3:
- return '建站';
- case 4:
- return '获取资讯';
- case 5:
- return '详细方案';
- default:
- return '普通询盘';
- }
- }
- }
|