12345678910111213141516171819202122232425 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Support\Facades\DB;
- class RecommendTag extends Model
- {
- protected $table = 'recommend_tag';
- public $timestamps = false;
- public static function selectRecommendTag($status=1){
- $tagDataList=DB::table('recommend_tag')->select('id','name','url')->where('status',$status)->offset(0)->limit(5)->get()->toArray();
- if(!empty($tagDataList)){
- $tagDataList[5]=["id"=>6,'name'=>'更多','url'=>'https://apicaipu.726p.com/Uploads/RecommendTag/more.png'];
- }
- if(empty($tagDataList)){
- return [];
- }
- return $tagDataList;
- }
- }
|