12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace App\Http\Controllers\Channel\Book;
- use App\Modules\Book\Services\BookChannelScoreService;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Channel\BaseController;
- use Hashids;
- class BookChannelScoreController extends BaseController
- {
-
-
- public function score(Request $request)
- {
- $channel_id = $this->getChannelId();
- $score = $request->post('score');
- $bid = $request->post('bid');
- if (empty($score) || empty($bid)) {
- return response()->error("PARAM_EMPTY");
- }
- if (!is_numeric($bid)) {
- $bid = Hashids::decode($bid)[0];
- }
- if (strlen($score) != 1 || is_numeric($score) || !in_array(strtoupper($score), range('A', 'Z'))) {
-
- }
- BookChannelScoreService::score($channel_id, strtoupper($score), $bid);
- return response()->success();
- }
- }
|