Address.php 669 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 2017/3/25
  6. * Time: 下午1:48
  7. */
  8. namespace app\common\models\member;
  9. use app\common\models\BaseModel;
  10. class Address extends BaseModel
  11. {
  12. public $table = 'yz_address';
  13. public $timestamps = false;
  14. public $guarded = [''];
  15. /*
  16. * 获取地址数据表全部数据
  17. *
  18. * @return array */
  19. public static function getAllAddress()
  20. {
  21. //return static::all()->toArray();
  22. $model = static::orderBy('parentid', 'asc')->get();
  23. if ($model->isEmpty()) {
  24. return array();
  25. }
  26. return $model->toArray();
  27. }
  28. }