AttachmentGroup.php 883 B

123456789101112131415161718192021222324252627282930313233343536373839
  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\Core;
  7. class AttachmentGroup extends \We7Table {
  8. protected $tableName = 'attachment_group';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'pid',
  12. 'name',
  13. 'uniacid',
  14. 'uid',
  15. 'type',
  16. );
  17. protected $default = array(
  18. 'pid' => '0',
  19. 'name' => '',
  20. 'uniacid' => '0',
  21. 'uid' => '0',
  22. 'type' => '0',
  23. );
  24. public function searchWithUniacidOrUid($uniacid, $uid, $attachment_by_uid = '') {
  25. if (empty($uniacid)) {
  26. $this->query->where('uniacid', 0)->where('uid', $uid);
  27. } else {
  28. if (empty($attachment_by_uid)) {
  29. $this->query->where('uniacid', $uniacid);
  30. } else {
  31. $this->query->where('uniacid', $uniacid)->where('uid', $uid);
  32. }
  33. }
  34. return $this;
  35. }
  36. }