Account.php 754 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. *------Create thems Model------
  4. *------SCWPHP Version 1.0.0------
  5. *------Dev Model Jions------
  6. *------Create Time 2017-06-13 18:45:24------
  7. */
  8. namespace App\Commons\Model;
  9. use \System\Model;
  10. class Account extends Model {
  11. public $timestamps = false;
  12. protected $table = 'account';
  13. private function getFeild($num) {
  14. $data = array(
  15. '1' => 'id',
  16. '2' => 'identity',
  17. '3' => 'account',
  18. '4' => 'status',
  19. );
  20. return $data[$num];
  21. }
  22. function getinfo($value, $type = 1){
  23. $key = $this->getFeild($type);
  24. $data = $this->where($key, $value)->first();
  25. if (!$data) {
  26. return -30203000202;
  27. }
  28. return $data->toArray();
  29. }
  30. }