Supplier.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: yunzhong
  5. * Date: 2018/10/15
  6. * Time: 16:32
  7. */
  8. namespace app\backend\modules\charts\models;
  9. use Yunshop\Supplier\common\models\SupplierWithdraw;
  10. use Yunshop\Supplier\supplier\models\SupplierOrder;
  11. class Supplier extends \Yunshop\Supplier\common\models\Supplier
  12. {
  13. public function hasOneSupplierOrder()
  14. {
  15. return $this->hasOne(SupplierOrder::class, 'supplier_id', 'id'); // TODO: Change the autogenerated stub
  16. }
  17. public function hasManySupplierOrderCount()
  18. {
  19. return $this->hasMany(SupplierOrder::class, 'supplier_id', 'id'); // TODO: Change the autogenerated stub
  20. }
  21. public function hasOneSupplierWithdraw()
  22. {
  23. return $this->hasOne(SupplierWithdraw::class, 'supplier_id', 'id'); // TODO: Change the autogenerated stub
  24. }
  25. public function hasOneSupplierWithdrawing()
  26. {
  27. return $this->hasOne(SupplierWithdraw::class, 'supplier_id', 'id'); // TODO: Change the autogenerated stub
  28. }
  29. public function hasManyOrder()
  30. {
  31. return $this->belongsToMany(\app\common\models\Order::class,'yz_supplier_order', 'supplier_id', 'order_id');
  32. }
  33. }