ProductCategoryModel.php 568 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\common\model;
  3. class ProductCategoryModel extends BaseModel
  4. {
  5. protected $table = 'erp_product_category';
  6. protected function genSchema(array $schema)
  7. {
  8. // TODO: Implement genSchema() method.
  9. }
  10. public function findAll() {
  11. return $this->where('is_delete', 0)->select();
  12. }
  13. public function doesItExist($name) {
  14. $customer = $this->where([
  15. ["name", '=', $name],
  16. ["is_delete", '=', 0]
  17. ])->find();
  18. return $customer ? true : false;
  19. }
  20. }