Money_details.php 621 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. *------Create thems Model------
  4. *------SCWPHP Version 1.0.0------
  5. *------Dev Model Jions------
  6. *------Create Time 2017-06-28 13:05:26------
  7. */
  8. namespace App\Commons\Model;
  9. use \System\Model;
  10. class Money_details extends Model {
  11. public $timestamps = false;
  12. protected $table = 'money_details';
  13. function countUser($timearea, $array) {
  14. $data = $this->select('account_name')->whereBetween('money_time', $timearea)->whereIn('trade_type', $array)->groupBy('account_name')->get();
  15. if (!$data) {
  16. return 0;
  17. }
  18. $data = $data->toArray();
  19. return count($data);
  20. }
  21. }