Styles.php 773 B

12345678910111213141516171819202122232425262728293031
  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\Site;
  7. class Styles extends \We7Table {
  8. protected $tableName = 'site_styles';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uniacid',
  12. 'templateid',
  13. 'name',
  14. );
  15. protected $default = array(
  16. 'uniacid' => '',
  17. 'templateid' => '',
  18. 'name' => '',
  19. );
  20. public function getById($id) {
  21. global $_W;
  22. return $this->query->where('id', $id)->where('uniacid', $_W['uniacid'])->get();
  23. }
  24. public function searchWithTemplates() {
  25. return $this->query->from('site_styles', 'a')->select('a.*')->leftjoin('site_templates', 'b')->on(array('a.templateid' => 'b.id'));
  26. }
  27. }