AstrictPhone.php 636 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/3/4
  6. * Time: 上午9:28
  7. */
  8. namespace common\models;
  9. class AstrictPhone extends Common
  10. {
  11. public function rules()
  12. {
  13. return [
  14. ['mobile', 'number', 'message' => '请输入正确的电话号码'],
  15. ];
  16. }
  17. public function getList($input)
  18. {
  19. $query = self::find();
  20. $query->offset(($input['page']-1)*$input['limit']);
  21. $query->limit($input['limit']);
  22. return $query->asArray()->all();
  23. }
  24. public function getTotal()
  25. {
  26. $query = self::find();
  27. return $query->count();
  28. }
  29. }