|
|
|
@ -3,6 +3,7 @@ namespace app\controller; |
|
|
|
|
|
|
|
use app\BaseController; |
|
|
|
use app\model\AwardsRecords; |
|
|
|
use app\model\RotationChart; |
|
|
|
use app\model\User as UserModel; |
|
|
|
use think\facade\Request; |
|
|
|
|
|
|
|
@ -18,6 +19,39 @@ class Index extends BaseController |
|
|
|
return 'hello,' . $name; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 轮播图 |
|
|
|
* @author whj |
|
|
|
* @date 2023-08-30 9:50 |
|
|
|
*/ |
|
|
|
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 |
|
|
|
@ -30,7 +64,7 @@ class Index extends BaseController |
|
|
|
|
|
|
|
$data = Request::param(); |
|
|
|
|
|
|
|
$limit = $data['limit'] ?: 10; |
|
|
|
$limit = $data['limit'] ?? 10; |
|
|
|
|
|
|
|
$records = new AwardsRecords(); |
|
|
|
|
|
|
|
|