|
|
@@ -189,4 +189,46 @@ class NewPc extends BaseController
|
|
|
$data['winnings'] = $arr;
|
|
|
return $this->success($data);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @api {get} /newPc 结果,走势
|
|
|
+ * @apiGroup newPc
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ *
|
|
|
+ * @apiParam {int} [page=1]
|
|
|
+ * @apiParam {int} [limit=10]
|
|
|
+ *
|
|
|
+ * @apiSuccess {int} code
|
|
|
+ * @apiSuccess {int} timestamp
|
|
|
+ * @apiSuccess {String} msg
|
|
|
+ * @apiSuccess {Object[]} data
|
|
|
+ * @apiSuccess {int} data.id
|
|
|
+ * @apiSuccess {String} data.issue_no 期号
|
|
|
+ * @apiSuccess {String} data.start_time 开始时间
|
|
|
+ * @apiSuccess {String} data.end_time 结束时间
|
|
|
+ * @apiSuccess {String[]} data.award 开奖结果
|
|
|
+ * @apiSuccess {String[]} data.winning_array 开奖结果
|
|
|
+ * @apiSuccess {int} data.end_timestamp 结束时间 时间戳
|
|
|
+ *
|
|
|
+ */
|
|
|
+ public function index()
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $page = request()->input('page', 1);
|
|
|
+ $limit = request()->input('limit', 10);
|
|
|
+
|
|
|
+
|
|
|
+ $res['total'] = PcIssue::count();
|
|
|
+ $res['data'] = PcIssue::forPage($page, $limit)
|
|
|
+ ->orderByDesc('id')->get();
|
|
|
+ foreach ($res['data'] as &$item) {
|
|
|
+ $item['day'] = date("m-d H:i", strtotime($item['end_time']));
|
|
|
+ }
|
|
|
+ } catch (ValidationException $e) {
|
|
|
+ return $this->error($e->validator->errors()->first());
|
|
|
+ } catch (Exception $e) {
|
|
|
+ return $this->error($e->getMessage());
|
|
|
+ }
|
|
|
+ return $this->success($res);
|
|
|
+ }
|
|
|
}
|