|
@@ -28,12 +28,13 @@ class Custom extends Auth{
|
|
|
* 列表页
|
|
|
*
|
|
|
* */
|
|
|
- public function index(Model $Model,CustomScore $CustomScore,WeiBanFollow $WeiBanFollow){
|
|
|
+ public function index(Model $Model,CustomScore $CustomScore,WeiBanFollow $WeiBanFollow,City $City){
|
|
|
// 接受参数
|
|
|
$code = request('custom_code','');
|
|
|
$phone = request('phone','');
|
|
|
$username = request('username','');
|
|
|
$weibanId = request('weiban_extid','');
|
|
|
+ $cityId = request('city_id',0);
|
|
|
$status = request('status');
|
|
|
$startTime = request('start_time','');
|
|
|
// 编码转ID
|
|
@@ -44,6 +45,7 @@ class Custom extends Auth{
|
|
|
if( $uid ) $map[] = ['uid','=',$uid];
|
|
|
if( $phone ) $map[] = ['phone','=',$phone];
|
|
|
if( $username ) $map[] = ['username','=',$username];
|
|
|
+ if( $cityId ) $map[] = ['city_id','=',$cityId];
|
|
|
if( $weibanId ) $map[] = ['weiban_extid','=',$weibanId];
|
|
|
if( $startTime ) $map[] = ['insert_time','>=',Carbon::createFromFormat('Y-m-d',$startTime)->startOfDay()->getTimestamp()];
|
|
|
if( $startTime ) $map[] = ['insert_time','<=',Carbon::createFromFormat('Y-m-d',$startTime)->endOfDay()->getTimestamp()];
|
|
@@ -52,6 +54,8 @@ class Custom extends Auth{
|
|
|
$list = $Model->query()->where($map)->orderByDesc('uid')->paginate(config('page_num',10))->appends(request()->all());
|
|
|
// 循环处理数据
|
|
|
foreach ($list as $key => $value) {
|
|
|
+ // 城市名
|
|
|
+ $value['city_name'] = $value['city_id'] ? $City->getOne($value['city_id'],'name') : '';
|
|
|
// id转编号
|
|
|
$value['custom_code'] = $Model->idToCode($value['uid']);
|
|
|
// id转编号
|
|
@@ -66,6 +70,10 @@ class Custom extends Auth{
|
|
|
// 重组
|
|
|
$list[$key] = $value;
|
|
|
}
|
|
|
+ // 获取列表
|
|
|
+ $cityList = $City->getCityList();
|
|
|
+ // 分配数据
|
|
|
+ $this->assign('cityList',$cityList);
|
|
|
// 分配数据
|
|
|
$this->assign('empty', '<tr><td colspan="20">~~暂无数据</td></tr>');
|
|
|
$this->assign('list',$list);
|