1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace app\model;
- use think\Model;
- class Designer extends Model
- {
- public function case()
- {
- return $this->hasMany(MaterialCase::class, 'designer_id','id');
- }
- public function getVcrAttr($value)
- {
- if (empty($value)) return $value;
- $domain = config('app.ali_oss_bindurl');
- $item = 'https://' . $domain . '/' . $value;
- return $item;
- }
- public function getHeadimgurlAttr($value)
- {
- if (empty($value)) return $value;
- $domain = config('app.ali_oss_bindurl');
- $item = 'https://' . $domain . '/' . $value;
- return $item;
- }
- public function getGoodAtAttr($value)
- {
- if (empty($value)) return [];
- $res = explode(',',$value);
- return $res;
- }
- public function getGoodHouseAttr($value)
- {
- if (empty($value)) return [];
- $res = explode(',',$value);
- return $res;
- }
- public function employee()
- {
- return $this->belongsTo(Employee::class)->bind(['employee_name'=>'name']);
- }
- }
|