GuaranteeValue.php 891 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\common\model\store;
  3. use app\common\model\BaseModel;
  4. class GuaranteeValue extends BaseModel
  5. {
  6. public static function tablePk(): string
  7. {
  8. return 'guarantee_value_id';
  9. }
  10. public static function tableName(): string
  11. {
  12. return 'guarantee_value';
  13. }
  14. public function value()
  15. {
  16. return $this->hasOne(Guarantee::class,'guarantee_id','guarantee_id')->where('is_del',0)->where('status',1);
  17. }
  18. public function searchGuaranteeIdAttr($query,$value)
  19. {
  20. $query->where('guarantee_id',$value);
  21. }
  22. public function searchDateAttr($query,$value)
  23. {
  24. getModelTime($query,$value);
  25. }
  26. public function searchStatusAttr($query,$value)
  27. {
  28. $query->where('status',$value);
  29. }
  30. public function searchIsDelAttr($query,$value)
  31. {
  32. $query->where('is_del',$value);
  33. }
  34. }