123456789101112131415161718192021222324252627282930 |
- <?php
- declare(strict_types=1);
- namespace app\logics;
- use app\model\CustomerClue as Model;
- class ClueLogic
- {
- public static function list($condition = [], $page, $limit, $order = 'addtime desc')
- {
- $page = intval($page);
- $limit = intval($limit);
- $data = Model::with(['user', 'employee', 'org'])->field('id, uid, employee_id, state,org_id, addtime,phone')
- ->where($condition)->page($page, $limit)->order($order)->select();
- foreach($data as &$item){
- if($item['phone']){
- $item['phone'] = substr_replace($item['phone'],'******',3,6);
- }
- }
- return $data;
- }
- public static function count($condition = [])
- {
- return Model::where($condition)->count();
- }
- }
|