Card.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. namespace We7\Table\Mc;
  7. class Card extends \We7Table {
  8. protected $tableName = 'mc_card';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uniacid',
  12. 'title',
  13. 'color',
  14. 'background',
  15. 'logo',
  16. 'format_type',
  17. 'format',
  18. 'description',
  19. 'fields',
  20. 'snpos',
  21. 'status',
  22. 'business',
  23. 'discount_type',
  24. 'discount',
  25. 'grant',
  26. 'grant_rate',
  27. 'offset_rate',
  28. 'offset_max',
  29. 'nums_status',
  30. 'nums_text',
  31. 'nums',
  32. 'times_status',
  33. 'times_text',
  34. 'times',
  35. 'params',
  36. 'html',
  37. 'recommend_status',
  38. 'sign_status',
  39. 'brand_name',
  40. 'notice',
  41. 'quantity',
  42. 'max_increase_bonus',
  43. 'least_money_to_use_bonus',
  44. 'source',
  45. 'card_id',
  46. );
  47. protected $default = array(
  48. 'uniacid' => '',
  49. 'title' => '',
  50. 'color' => '',
  51. 'background' => '',
  52. 'logo' => '',
  53. 'format_type' => 0,
  54. 'format' => '',
  55. 'description' => '',
  56. 'fields' => '',
  57. 'snpos' => '',
  58. 'status' => 1,
  59. 'business' => '',
  60. 'discount_type' => '',
  61. 'discount' => '',
  62. 'grant' => '',
  63. 'grant_rate' => 0,
  64. 'offset_rate' => 0,
  65. 'offset_max' => 0,
  66. 'nums_status' => 0,
  67. 'nums_text' => '',
  68. 'nums' => '',
  69. 'times_status' => 0,
  70. 'times_text' => '',
  71. 'times' => '',
  72. 'params' => '',
  73. 'html' => '',
  74. 'recommend_status' => 0,
  75. 'sign_status' => 0,
  76. 'brand_name' => '',
  77. 'notice' => '',
  78. 'quantity' => 0,
  79. 'max_increase_bonus' => 0,
  80. 'least_money_to_use_bonus' => 0,
  81. 'source' => 1,
  82. 'card_id' => '',
  83. );
  84. public function getByStatus($status, $uniacid) {
  85. return $this->query->where('status', $status)->where('uniacid', $uniacid)->get();
  86. }
  87. }