1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\model;
- use think\Model;
- class Huoma extends Model
- {
- public function zima()
- {
- return $this->hasMany(HuomaZima::class, 'mid','id');
- }
- public function company(){
- return $this->hasOne(Company::class, 'root_id','root_id');
- }
- /**
- * 图片拼接
- */
- public function getPosterImgAttr($value)
- {
- if (empty($value)) return $value;
- $ali_oss_bindurl = config('app.ali_oss_bindurl');
- $url = 'http://' . $ali_oss_bindurl . '/' . $value;
- return $url;
- }
- public function employee(){
- return $this->hasOne(Employee::class, 'id','employee_id')->bind(['opt_name']);
- }
- }
|