123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?php
- namespace App\Http\Controllers\Deed;
- use App\Http\Controllers\Controller;
- use App\Http\Controllers\Core\Auth;
- use App\Services\Deed\DeedService;
- use Illuminate\Http\Request;
- class DeedController extends Controller
- {
- /**
- * 活跃的契约
- * @param Request $request
- * @return array
- * @throws \Tymon\JWTAuth\Exceptions\JWTException
- */
- public function ings(Request $request)
- {
- $uid = Auth::auth();
- $page = $request->get('page') ?? 1;
- $pages = array(
- 'limit' => 20,
- 'page' => $page
- );
- $ds = new DeedService();
- $data = $ds->ings($uid, $pages);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 不活跃的契约
- * @param Request $request
- * @return array
- * @throws \Tymon\JWTAuth\Exceptions\JWTException
- */
- public function succs(Request $request)
- {
- $uid = Auth::auth();
- $page = $request->get('page') ?? 1;
- $pages = array(
- 'limit' => 20,
- 'page' => $page
- );
- $ds = new DeedService();
- $data = $ds->succs($uid, $pages);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 查看契约信息
- * @param int $deed_id
- * @return array
- */
- public function show(int $deed_id)
- {
- $ds = new DeedService();
- $data = $ds->get($deed_id);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 查看契约信息
- * @param Request $request
- * @return array
- * @throws \App\Exceptions\AlertException
- * @throws \Tymon\JWTAuth\Exceptions\JWTException
- */
- public function getbytua(Request $request)
- {
- $uid = Auth::auth();
- $this->validate($request, [
- 'type' => 'required',
- 'ack' => 'required',
- ]);
- $type = $request->post('type');
- $ack = $request->post('ack');
- $ds = new DeedService();
- $data = $ds->getByTUA($type, $uid, $ack);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- /**
- * 查看契约信息
- * @param Request $request
- * @return array
- * @throws \App\Exceptions\AlertException
- * @throws \Tymon\JWTAuth\Exceptions\JWTException
- */
- public function getbytuw(Request $request)
- {
- $uid = Auth::auth();
- $this->validate($request, [
- 'type' => 'required',
- 'way' => 'required',
- 'way_id' => 'required',
- ]);
- $type = $request->post('type');
- $way = $request->post('way');
- $way_id = $request->post('way_id');
- $ds = new DeedService();
- $data = $ds->getByTUW($type, $uid, $way, $way_id);
- return array(
- 'code' => 200,
- 'message' => 'success',
- 'data' => $data
- );
- }
- }
|