*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }
:)
ThinkPHP V' . \think\facade\App::version() . '
14载初心不改 - 你值得信赖的PHP框架
[ V6.0 版本由 亿速云 独家赞助发布 ] ';
}
public function hello($name = 'ThinkPHP6')
{
return 'hello,' . $name;
}
/**
* 轮播图
*/
public function rotationChart()
{
$data = Request::param();
$limit = $data['limit'] ?? 11;
$RotationChart = new RotationChart();
$list = $RotationChart
->field('image,url')
->where('status',1)
->order('create_time desc')
->paginate($limit);
$data = $list->toArray()['data'];
foreach ($data as &$item) {
$item['image'] = get_image_url($item['image']);
$item['url'] = get_jump_url($item['url']);
}
return $this->renderSuccess('数据返回成功',[
'list' => $data,
'total' => $list->total()
]);
}
/**
* 获取首页中间记录
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function awardRecords()
{
$data = Request::param();
$limit = $data['limit'] ?? 10;
$records = new AwardsRecords();
$list = $records->field('user_id,awards_amount')->order('create_time desc')->paginate($limit);
$data = $list->toArray()['data'];
foreach ($data as &$item) {
$item['user_id'] .= "XX";
$user = UserModel::field('phone')->find($item['user_id']);
$item['phone'] = format_phone_number($user['phone']);
$item['awards_amount'] = number_format($item['awards_amount']);
}
return $this->renderSuccess('数据返回成功',[
'list' => $data,
'total' => $list->total()
]);
}
}