123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace app\model;
- use think\Model;
- class AgentShareLog extends Model
- {
- public function user()
- {
- return $this->hasOne(User::class, 'id','uid')->bind(['nickname', 'headimgurl']);
- }
- public function agentUser()
- {
- return $this->hasOne(AgentUser::class, 'agent_employee_id','employee_id')->bind(['agent_name','type']);
- }
- public function getAddtimeAttr($value)
- {
- if (empty($value)) return $value;
- $date = date('Y-m-d',$value);
- return $date;
- }
- public function getImgAttr($value)
- {
- if (empty($value)) return $value;
- $array = explode(',', $value);
- $domain = config('app.ali_oss_bindurl');
- foreach($array as &$item){
- $item = 'https://'.$domain.'/'.$item;
- }
- return $array;
- }
- }
|