Commit 60771229 by 杨树贤

修改服务请求为POST

parent d2e2cfe7
...@@ -14,8 +14,9 @@ use Illuminate\Support\Facades\Log; ...@@ -14,8 +14,9 @@ use Illuminate\Support\Facades\Log;
class ExchangeSettingsController extends Controller class ExchangeSettingsController extends Controller
{ {
public function show($id) public function show(Request $request)
{ {
$id = $request->id;
$exchangeSetting = ExchangeSetting::find($id)->toArray(); $exchangeSetting = ExchangeSetting::find($id)->toArray();
return $this->Export(0, 'ok', ['data' => $exchangeSetting]); return $this->Export(0, 'ok', ['data' => $exchangeSetting]);
...@@ -54,8 +55,9 @@ class ExchangeSettingsController extends Controller ...@@ -54,8 +55,9 @@ class ExchangeSettingsController extends Controller
} }
} }
public function update(Request $request, $id) public function update(Request $request)
{ {
$id = $request->id;
$data = array_merge($request->all(), ['update_time' => time()]); $data = array_merge($request->all(), ['update_time' => time()]);
$res = DB::table('exchange_settings')->where('id', $id) $res = DB::table('exchange_settings')->where('id', $id)
->update($data); ->update($data);
...@@ -63,8 +65,9 @@ class ExchangeSettingsController extends Controller ...@@ -63,8 +65,9 @@ class ExchangeSettingsController extends Controller
return $this->Export(0, 'ok'); return $this->Export(0, 'ok');
} }
public function destroy($ids) public function destroy(Request $request)
{ {
$ids = $request->ids;
$ids = explode(',', trim($ids)); $ids = explode(',', trim($ids));
$res = DB::table('exchange_settings')->whereIn('id', $ids)->delete(); $res = DB::table('exchange_settings')->whereIn('id', $ids)->delete();
if ($res) { if ($res) {
......
...@@ -43,8 +43,9 @@ class IntegralBillsController extends Controller ...@@ -43,8 +43,9 @@ class IntegralBillsController extends Controller
} }
} }
public function update(Request $request, $id) public function update(Request $request)
{ {
$id = $request->id;
$res = DB::table('integral_bills')->where('id', $id) $res = DB::table('integral_bills')->where('id', $id)
->update([ ->update([
'user_id' => $request->user_id, 'user_id' => $request->user_id,
...@@ -60,8 +61,9 @@ class IntegralBillsController extends Controller ...@@ -60,8 +61,9 @@ class IntegralBillsController extends Controller
} }
} }
public function destroy($ids) public function destroy(Request $request)
{ {
$ids = $request->ids;
$ids = explode(',', trim($ids)); $ids = explode(',', trim($ids));
$res = DB::table('integral_bills')->whereIn('id', $ids)->delete(); $res = DB::table('integral_bills')->whereIn('id', $ids)->delete();
if ($res) { if ($res) {
......
...@@ -32,12 +32,13 @@ class IntegralTypesController extends Controller ...@@ -32,12 +32,13 @@ class IntegralTypesController extends Controller
} }
} }
public function update(Request $request, $id) public function update(Request $request)
{ {
$id = $request->id;
$res = DB::table('integral_types')->where('id', $id) $res = DB::table('integral_types')->where('id', $id)
->update([ ->update([
'name' => $request->name, 'name' => $request->name,
'status' => $request->status, 'status' => $request->status,
]); ]);
if ($res) { if ($res) {
return $this->Export(0, 'ok'); return $this->Export(0, 'ok');
...@@ -46,8 +47,9 @@ class IntegralTypesController extends Controller ...@@ -46,8 +47,9 @@ class IntegralTypesController extends Controller
} }
} }
public function destroy($ids) public function destroy(Request $request)
{ {
$ids = $request->ids;
$ids = explode(',', trim($ids)); $ids = explode(',', trim($ids));
$res = DB::table('integral_types')->whereIn('id', $ids)->delete(); $res = DB::table('integral_types')->whereIn('id', $ids)->delete();
if ($res) { if ($res) {
......
...@@ -12,8 +12,9 @@ use Illuminate\Support\Facades\Log; ...@@ -12,8 +12,9 @@ use Illuminate\Support\Facades\Log;
class IntegralsController extends Controller class IntegralsController extends Controller
{ {
public function show($id) public function show(Request $request)
{ {
$id = $request->id;
$integral = Integral::find($id)->toArray(); $integral = Integral::find($id)->toArray();
return $this->Export(0, 'ok', ['data' => $integral]); return $this->Export(0, 'ok', ['data' => $integral]);
...@@ -51,8 +52,9 @@ class IntegralsController extends Controller ...@@ -51,8 +52,9 @@ class IntegralsController extends Controller
} }
} }
public function update(Request $request, $id) public function update(Request $request)
{ {
$id = $request->id;
$data = array_merge($request->all(), ['update_time' => time()]); $data = array_merge($request->all(), ['update_time' => time()]);
$res = DB::table('integrals')->where('id', $id) $res = DB::table('integrals')->where('id', $id)
->update($data); ->update($data);
...@@ -75,8 +77,9 @@ class IntegralsController extends Controller ...@@ -75,8 +77,9 @@ class IntegralsController extends Controller
// return $this->Export(033, '批量修改用户积分失败'); // return $this->Export(033, '批量修改用户积分失败');
} }
public function destroy($ids) public function destroy(Request $request)
{ {
$ids = $request->ids;
$ids = explode(',', trim($ids)); $ids = explode(',', trim($ids));
$res = DB::table('integrals')->whereIn('id', $ids)->delete(); $res = DB::table('integrals')->whereIn('id', $ids)->delete();
if ($res) { if ($res) {
......
...@@ -12,8 +12,9 @@ use Illuminate\Support\Facades\Log; ...@@ -12,8 +12,9 @@ use Illuminate\Support\Facades\Log;
class UserExchangesController extends Controller class UserExchangesController extends Controller
{ {
public function show($id) public function show(Request $request)
{ {
$id = $request->id;
$userExchange = UserExchange::where('user_id', $id)->first()->toArray(); $userExchange = UserExchange::where('user_id', $id)->first()->toArray();
return $this->Export(0, 'ok', ['data' => $userExchange]); return $this->Export(0, 'ok', ['data' => $userExchange]);
...@@ -32,8 +33,9 @@ class UserExchangesController extends Controller ...@@ -32,8 +33,9 @@ class UserExchangesController extends Controller
return $this->Export(0, 'ok', ['data' => $userExchanges, 'count' => $count]); return $this->Export(0, 'ok', ['data' => $userExchanges, 'count' => $count]);
} }
public function update(Request $request, $id) public function update(Request $request)
{ {
$id = $request->id;
$data = array_merge($request->all(), ['update_time' => time()]); $data = array_merge($request->all(), ['update_time' => time()]);
$res = DB::table('user_exchanges')->where('id', $id) $res = DB::table('user_exchanges')->where('id', $id)
->update($data); ->update($data);
......
...@@ -13,8 +13,9 @@ use Illuminate\Support\Facades\Log; ...@@ -13,8 +13,9 @@ use Illuminate\Support\Facades\Log;
class UserIntegralsController extends Controller class UserIntegralsController extends Controller
{ {
public function show($id) public function show(Request $request)
{ {
$id = $request->id;
$integral = UserIntegral::where('user_id', $id)->first(); $integral = UserIntegral::where('user_id', $id)->first();
$integral = $integral ?: []; $integral = $integral ?: [];
...@@ -33,8 +34,9 @@ class UserIntegralsController extends Controller ...@@ -33,8 +34,9 @@ class UserIntegralsController extends Controller
return $this->Export(0, 'ok', ['data' => $integrals, 'count' => $count]); return $this->Export(0, 'ok', ['data' => $integrals, 'count' => $count]);
} }
public function update(Request $request, $id) public function update(Request $request)
{ {
$id = $request->id;
$data = array_merge($request->all(), ['update_time' => time()]); $data = array_merge($request->all(), ['update_time' => time()]);
$res = DB::table('user_integrals')->where('id', $id) $res = DB::table('user_integrals')->where('id', $id)
->update($data); ->update($data);
......
...@@ -20,43 +20,43 @@ $router->get('/key', function () { ...@@ -20,43 +20,43 @@ $router->get('/key', function () {
}); });
//积分信息 //积分信息
$router->get('/integrals', 'IntegralsController@index'); $router->post('/integrals/list', 'IntegralsController@index');
$router->get('/integrals/{id}', 'IntegralsController@show'); $router->post('/integrals/info', 'IntegralsController@show');
$router->post('/integrals', 'IntegralsController@create'); $router->post('/integrals/add', 'IntegralsController@create');
$router->patch('/integrals/{id}', 'IntegralsController@update'); $router->post('/integrals/update', 'IntegralsController@update');
$router->delete('/integrals/{id}', 'IntegralsController@destroy'); $router->post('/integrals/delete', 'IntegralsController@destroy');
$router->post('/integrals/batchUpdateStatus', 'IntegralsController@batchUpdateStatus'); $router->post('/integrals/batchUpdateStatus', 'IntegralsController@batchUpdateStatus');
//积分类型 //积分类型
$router->get('/integral_types', 'IntegralTypesController@index'); $router->post('/integral_types/list', 'IntegralTypesController@index');
$router->post('/integral_types', 'IntegralTypesController@create'); $router->post('/integral_types/add', 'IntegralTypesController@create');
$router->patch('/integral_types/{id}', 'IntegralTypesController@update'); $router->post('/integral_types/update', 'IntegralTypesController@update');
$router->delete('/integral_types/{id}', 'IntegralTypesController@destroy'); $router->post('/integral_types/delete', 'IntegralTypesController@destroy');
//用户积分账单 //用户积分账单
$router->get('/integral_bills', 'IntegralBillsController@index'); $router->post('/integral_bills/list', 'IntegralBillsController@index');
$router->post('/integral_bills', 'IntegralBillsController@create'); $router->post('/integral_bills/add', 'IntegralBillsController@create');
$router->patch('/integral_bills/{id}', 'IntegralBillsController@update'); $router->post('/integral_bills/update', 'IntegralBillsController@update');
$router->delete('/integral_bills/{id}', 'IntegralBillsController@destroy'); $router->post('/integral_bills/delete', 'IntegralBillsController@destroy');
//用户积分信息 //用户积分信息
$router->get('/user_integrals/{id}', 'UserIntegralsController@show'); $router->post('/user_integrals/info', 'UserIntegralsController@show');
$router->get('/user_integrals', 'UserIntegralsController@index'); $router->post('/user_integrals/list', 'UserIntegralsController@index');
$router->patch('/user_integrals/{id}', 'UserIntegralsController@update'); $router->post('/user_integrals/update', 'UserIntegralsController@update');
$router->post('/user_integrals/batchUpdateStatus', 'UserIntegralsController@batchUpdateStatus'); $router->post('/user_integrals/batchUpdateStatus', 'UserIntegralsController@batchUpdateStatus');
//兑换配置 //兑换配置
$router->get('/exchange_settings/{id}', 'ExchangeSettingsController@show'); $router->post('/exchange_settings/info', 'ExchangeSettingsController@show');
$router->get('/exchange_settings', 'ExchangeSettingsController@index'); $router->post('/exchange_settings/list', 'ExchangeSettingsController@index');
$router->post('/exchange_settings', 'ExchangeSettingsController@store'); $router->post('/exchange_settings/add', 'ExchangeSettingsController@store');
$router->patch('/exchange_settings/{id}', 'ExchangeSettingsController@update'); $router->post('/exchange_settings/update', 'ExchangeSettingsController@update');
$router->delete('/exchange_settings/{id}', 'ExchangeSettingsController@destroy'); $router->post('/exchange_settings/delete', 'ExchangeSettingsController@destroy');
$router->post('/exchange_settings/batchUpdateStatus', 'ExchangeSettingsController@batchUpdateStatus'); $router->post('/exchange_settings/batchUpdateStatus', 'ExchangeSettingsController@batchUpdateStatus');
//用户兑换记录 //用户兑换记录
$router->get('/user_exchanges/{id}', 'UserExchangesController@show'); $router->post('/user_exchanges/info', 'UserExchangesController@show');
$router->get('/user_exchanges', 'UserExchangesController@index'); $router->post('/user_exchanges/list', 'UserExchangesController@index');
$router->patch('/user_exchanges/{id}', 'UserExchangesController@update'); $router->post('/user_exchanges/update', 'UserExchangesController@update');
$router->post('/user_exchanges/batchUpdateStatus', 'UserExchangesController@batchUpdateStatus'); $router->post('/user_exchanges/batchUpdateStatus', 'UserExchangesController@batchUpdateStatus');
28382 5983
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment