菜谱项目

Vest.php 505B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Support\Facades\DB;
  5. class Vest extends Model
  6. {
  7. protected $table = 'vest';
  8. public $timestamps = false;
  9. /*
  10. * 根据马甲id 查找马甲头像
  11. */
  12. public static function get_img_by_id($id)
  13. {
  14. $http = config('constants.HOST_URL');
  15. $vset = DB::table('vest')->where('id',$id)->first();
  16. $vest = (array)$vset;
  17. $img = $http.$vest['img'];
  18. return $img;
  19. }
  20. }