ClueLogic.php 779 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. declare(strict_types=1);
  3. namespace app\logics;
  4. use app\model\CustomerClue as Model;
  5. class ClueLogic
  6. {
  7. public static function list($condition = [], $page, $limit, $order = 'addtime desc')
  8. {
  9. $page = intval($page);
  10. $limit = intval($limit);
  11. $data = Model::with(['user', 'employee', 'org'])->field('id, uid, employee_id, state,org_id, addtime,phone')
  12. ->where($condition)->page($page, $limit)->order($order)->select();
  13. foreach($data as &$item){
  14. if($item['phone']){
  15. $item['phone'] = substr_replace($item['phone'],'******',3,6);
  16. }
  17. }
  18. return $data;
  19. }
  20. public static function count($condition = [])
  21. {
  22. return Model::where($condition)->count();
  23. }
  24. }