Wechats.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 Wechats extends \We7Table {
  8. protected $tableName = 'account_wechats';
  9. protected $primaryKey = 'acid';
  10. protected $field = array(
  11. 'uniacid',
  12. 'token',
  13. 'encodingaeskey',
  14. 'auth_refresh_token',
  15. 'level',
  16. 'name',
  17. 'account',
  18. 'original',
  19. 'signature',
  20. 'country',
  21. 'province',
  22. 'city',
  23. 'username',
  24. 'password',
  25. 'lastupdate',
  26. 'key',
  27. 'secret',
  28. 'styleid',
  29. 'subscribeurl',
  30. 'createtime',
  31. );
  32. protected $default = array(
  33. 'uniacid' => '',
  34. 'token' => '',
  35. 'encodingaeskey' => '',
  36. 'auth_refresh_token' => '',
  37. 'level' => '0',
  38. 'name' => '',
  39. 'account' => '',
  40. 'original' => '',
  41. 'signature' => '',
  42. 'country' => '',
  43. 'province' => '',
  44. 'city' => '',
  45. 'username' => '',
  46. 'password' => '',
  47. 'lastupdate' => '0',
  48. 'key' => '',
  49. 'secret' => '',
  50. 'styleid' => '1',
  51. 'subscribeurl' => '',
  52. 'createtime' => '',
  53. );
  54. public function getAccount($uniacid) {
  55. return $this->query->where('uniacid', $uniacid)->get();
  56. }
  57. public function searchWithAccount() {
  58. return $this->query->from($this->tableName, 't')
  59. ->leftjoin('account', 'a')
  60. ->on(array('t.uniacid' => 'a.uniacid'));
  61. }
  62. public function searchWithsearchWithAccountAndUniAccountUsers() {
  63. return $this->query->from($this->tableName, 't')
  64. ->leftjoin('account', 'a')
  65. ->on(array('t.uniacid' => 'a.uniacid'))
  66. ->leftjoin('uni_account_users', 'u')
  67. ->on(array('u.uniacid' => 't.uniacid'));
  68. }
  69. }