OrderLogistics.php 545 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * @property LogisticsCompany com
  6. * @property string trans_no
  7. * @property string from_address
  8. * @property string from_username
  9. * @property string from_mobile
  10. */
  11. class OrderLogistics extends Model
  12. {
  13. public function com(){
  14. return $this->belongsTo(LogisticsCompany::class,'com_id');
  15. }
  16. public function from(){
  17. return str_replace('/','',$this['from_area']?:'');
  18. }
  19. public function fullArea(){
  20. return $this->from().$this->from_address;
  21. }
  22. }