Wxapp.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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\Account;
  7. class Wxapp extends \We7Table {
  8. protected $tableName = 'account_wxapp';
  9. protected $primaryKey = 'acid';
  10. protected $field = array(
  11. 'uniacid',
  12. 'token',
  13. 'encodingaeskey',
  14. 'level',
  15. 'account',
  16. 'original',
  17. 'key',
  18. 'secret',
  19. 'name',
  20. 'appdomain',
  21. 'auth_refresh_token',
  22. );
  23. protected $default = array(
  24. 'uniacid' => '',
  25. 'token' => '',
  26. 'encodingaeskey' => '',
  27. 'level' => '',
  28. 'account' => '',
  29. 'original' => '',
  30. 'key' => '',
  31. 'secret' => '',
  32. 'name' => '',
  33. 'appdomain' => '',
  34. 'auth_refresh_token' => '',
  35. );
  36. public function getAccount($uniacid) {
  37. return $this->query->where('uniacid', $uniacid)->get();
  38. }
  39. public function wxappInfo($uniacid) {
  40. if (is_array($uniacid)) {
  41. return $this->query->where('uniacid', $uniacid)->getall('uniacid');
  42. } else {
  43. return $this->query->where('uniacid', $uniacid)->get();
  44. }
  45. }
  46. public function searchWithAccount() {
  47. return $this->query->from($this->tableName, 't')
  48. ->leftjoin('account', 'a')
  49. ->on(array('t.uniacid' => 'a.uniacid'));
  50. }
  51. }