PromotionPage.php 621 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: hp
  5. * Date: 2017/11/22
  6. * Time: 10:46
  7. */
  8. namespace App\Modules\Promotion\Models;
  9. use Illuminate\Database\Eloquent\Model;
  10. class PromotionPage extends Model
  11. {
  12. protected $connection = 'api_mysql';
  13. protected $table = 'promotion_pages';
  14. /**
  15. * @return mixed 获取所有的推广页面链接
  16. */
  17. static function getAllPromotionPage()
  18. {
  19. return $promotionPageResult = self::select('id', 'title', 'description', 'link')->where('is_enabled', 1)->get();
  20. }
  21. static function getById($page_id)
  22. {
  23. return self::find($page_id);
  24. }
  25. }