1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace app\model;
- use think\Model;
- class DailyWork extends Model
- {
-
- public function user(){
- return $this->belongsTo('user', 'uid')->bind(['headimgurl']);
- }
-
- public function employee(){
- return $this->hasOne('employee','uid','uid')->bind(['name', 'org_id']);
- }
-
- public function getEnclosureFileAttr($value)
- {
- if(empty($value)) return $value;
- $ali_oss_bindurl = config('app.ali_oss_bindurl');
- $str = explode(',',$value);
- $array = [];
- foreach($str as $v){
- $array[] = 'https://' . $ali_oss_bindurl .'/'. $v;
- }
- return $array;
- }
- public function getMediaIdAttr($value)
- {
- if (empty($value)) return '';
- $arr = explode(',', $value);
- return $arr;
- }
- public function getWeixinMediaAttr($value)
- {
- if (empty($value)) return '';
- $arr = explode(',', $value);
- return $arr;
- }
- }
|