saveAll([ //[ //'name' => '佩佩'.$i, //'mobile' => '1557692025'.$i, //'sex'=> 1, //'sun_calendar' => '2020-'.$i.'-11', //'lunar_calendar' => '2020-'.($i-1).'-19', //'user_id' => 100000, //'username' => 'Caviar.', //'relation' => '朋友'.$i, //'address' => '巴西'.$i, //'email' => $i.'@163.com', //'store_id' => 1, //'linkman' => 'A_Caviar' //] //]); //} /** * @param array $params * @return \think\Paginator * @throws \think\db\exception\DbException */ public function findCustomerPage(array $params) { $where = []; if(isset($params['name'])) { array_push($where,['name', 'like', "%".$params['name']."%"]); } if(count($where) > 0) { return $this->where($where)->paginate(10); } return $this->paginate(10); } }