MemberAddress.php 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /****************************************************************
  3. * Author: libaojia
  4. * Date: 2017/12/29 下午3:52
  5. * Email: livsyitian@163.com
  6. * QQ: 995265288
  7. * User: 芸众商城 www.yunzshop.com
  8. ****************************************************************/
  9. namespace app\backend\modules\member\models;
  10. use app\common\scopes\UniacidScope;
  11. class MemberAddress extends \app\common\models\MemberAddress
  12. {
  13. /**
  14. * 添加全局作用域
  15. */
  16. public static function boot()
  17. {
  18. parent::boot();
  19. self::addGlobalScope( new UniacidScope);
  20. }
  21. /**
  22. * 记录检索
  23. * @param $query
  24. * @return mixed
  25. */
  26. public function scopeRecords($query)
  27. {
  28. return $query;
  29. }
  30. /**
  31. * 检索条件 会员ID uid
  32. * @param $query
  33. * @param $uid
  34. * @return mixed
  35. */
  36. public function scopeOfUid($query, $uid)
  37. {
  38. return $query->where('uid', $uid);
  39. }
  40. }