master
cody 3 months ago
parent 696d49ca5b
commit da005d6047

@ -218,62 +218,5 @@ class StockCompanyController extends BaseController
return parent::destroy();
}
/**
* @OA\Get(
* path="/api/admin/stock-company/this-year-new",
* tags={"上市公司管理"},
* summary="今年新增上市公司",
* description="",
* @OA\Parameter(name="year", in="query", @OA\Schema(type="string"), required=false, description="年份,默认为当前年份"),
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
* @OA\Response(
* response="200",
* description="暂无"
* )
* )
*/
public function thisYearNew()
{
$all = request()->all();
$year = $all['year'] ?? date('Y');
$startDate = $year . '-01-01';
$endDate = $year . '-12-31';
$list = $this->model->whereBetween('stock_date', [$startDate, $endDate])
->orderBy('stock_date', 'desc')
->get();
return $this->success([
'year' => $year,
'total' => $list->count(),
'list' => $list
]);
}
/**
* @OA\Get(
* path="/api/admin/stock-company/after-enrollment",
* tags={"上市公司管理"},
* summary="入学后新上市公司数据显示",
* description="",
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
* @OA\Response(
* response="200",
* description="暂无"
* )
* )
*/
public function afterEnrollment()
{
$list = $this->model->where('is_after_enrollment', 1)
->orderBy('stock_date', 'desc')
->get();
return $this->success([
'total' => $list->count(),
'list' => $list
]);
}
}

Loading…
Cancel
Save