Guarantee.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\common\model\store;
  3. use app\common\model\BaseModel;
  4. class Guarantee extends BaseModel
  5. {
  6. public static function tablePk(): string
  7. {
  8. return 'guarantee_id';
  9. }
  10. public static function tableName(): string
  11. {
  12. return 'guarantee';
  13. }
  14. public function searchGuaranteeIdAttr($query,$value)
  15. {
  16. $query->where('guarantee_id',$value);
  17. }
  18. public function searchGuaranteeNameAttr($query,$value)
  19. {
  20. $query->where('guarantee_name',$value);
  21. }
  22. public function searchGuaranteeInfoAttr($query,$value)
  23. {
  24. $query->where('guarantee_Info',$value);
  25. }
  26. public function searchKeywordAttr($query,$value)
  27. {
  28. $query->whereLike('guarantee_name',"%{$value}%");
  29. }
  30. public function searchDateAttr($query,$value)
  31. {
  32. getModelTime($query,$value);
  33. }
  34. public function searchStatusAttr($query,$value)
  35. {
  36. $query->where('status',$value);
  37. }
  38. public function searchIsDelAttr($query,$value)
  39. {
  40. $query->where('is_del',$value);
  41. }
  42. }