13 changed files with 79 additions and 94 deletions
			
			
		- 
					7app/Http/Controllers/Api/AgentProductController.php
 - 
					6app/Http/Controllers/Api/ArticleController.php
 - 
					29app/Http/Controllers/Api/IndexController.php
 - 
					22app/Http/Controllers/Api/OrderController.php
 - 
					20app/Http/Controllers/Api/UserFavController.php
 - 
					21app/Models/Advertising.php
 - 
					22app/Models/Agent.php
 - 
					2app/Models/AgentProductItem.php
 - 
					11app/Models/Article.php
 - 
					8app/Models/BaseModel.php
 - 
					11app/Models/Channel.php
 - 
					4app/Models/Order.php
 - 
					10app/Models/Supplier.php
 
@ -1,21 +0,0 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
namespace App\Models; | 
				
			|||
 | 
				
			|||
use Illuminate\Database\Eloquent\Factories\HasFactory; | 
				
			|||
 | 
				
			|||
class Advertising extends BaseModel | 
				
			|||
{ | 
				
			|||
    use HasFactory; | 
				
			|||
 | 
				
			|||
	public function getPictureAttribute($value) | 
				
			|||
	{ | 
				
			|||
		return $value ? $this->host . $value : ''; | 
				
			|||
	} | 
				
			|||
 | 
				
			|||
	public function setPictureAttribute($value) | 
				
			|||
	{ | 
				
			|||
		//修改器里面$this->host变量为空
 | 
				
			|||
		$this->attributes['picture'] = str_replace(env('APP_URL'), '', $value); | 
				
			|||
	} | 
				
			|||
} | 
				
			|||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue