logo; return $this->imageUrl($value); } public function getIsRestTextAttribute($value) { $value = $value ? $value : $this->is_rest; return isset(self::$_ISREST[$value]) ? self::$_ISREST[$value] : ''; } public function getIsOpenTextAttribute($value) { $value = $value ? $value : $this->is_iopen; return isset(self::$_ISOPEN[$value]) ? self::$_ISOPEN[$value] : ''; } /** * 获取商家环境图片 * @param $value $this->environment * @return array */ public function getEnvironmentAttribute($value) { $value = $value ? $value : $this->environmant; return $value ? explode(',',$value) : []; } public function setEnvironmentAttribute($value) { $this->attributes['environment'] = implode(',',$value); } /** * 获取单个店铺信息 * @param int $id * @param string $field * @return string */ public static function getStoreInfo($id,$field = '*') { return self::select($field)->find($id); } /** * 获取店铺数组 * id为键,name为值 * @return array */ public static function getStoreArray($where = [], $options = []) { $model = self::select('id','name') ->where('status',2) ->whereNull('deleted_at'); if(count($where) > 0){ $model->where($where); } $list = $model->get(); $array = []; if(count($list) > 0){ foreach ($list as $value) { $array[$value->id] = $value->name; } } return $array; } // 处理图片 public function imageUrl($value) { if(strripos($value,"http") === false){ return config('filesystems.disks.oss.img_host').'/'.$value; }else{ return $value; } } // 关联旧流水 public function storeAccount() { return $this->belongsTo('App\Models\v3\StoreAccount','store_id','id','light'); } // 关联流水 public function financialRecord0() { return $this->belongsTo('App\Models\FinancialRecord0','user_id','user_id','light'); } // 关联流水 public function financialRecord1() { return $this->belongsTo('App\Models\FinancialRecord1','user_id','user_id','light'); } // 关联流水 public function financialRecord2() { return $this->belongsTo('App\Models\FinancialRecord2','user_id','user_id','light'); } // 关联流水 public function financialRecord3() { return $this->belongsTo('App\Models\FinancialRecord3','user_id','user_id','light'); } // 关联流水 public function financialRecord4() { return $this->belongsTo('App\Models\FinancialRecord4','user_id','user_id','light'); } }