123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <?php
- // +----------------------------------------------------------------------
- // | [ WE CAN DO IT MORE SIMPLE ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2018-2020 rights reserved.
- // +----------------------------------------------------------------------
- // |
- // +----------------------------------------------------------------------
- // | Date: 2020-11-08 12:56
- // +----------------------------------------------------------------------
- namespace app\system\controller;
- use app\BaseController;
- use app\model\api\User as UserModel;
- use app\model\api\ServiceType as ServiceTypeModel;
- use app\model\api\UserShowTemplate;
- use app\model\api\InfoAudit;
- use app\model\api\TypeAudit;
- use app\model\api\UserAudit;
- use app\model\api\ServiceType;
- use app\model\api\ServiceTimeType;
- use app\model\api\City as CityModel;
- use app\model\api\Sys as SysModel;
- use think\db\exception\DbException;
- use think\facade\Db;
- use app\Request;
- use library\services\UtilService;
- use library\utils\UserUtilsTool;
- class Audit extends BaseController
- {
-
- /***********************************审核******************************/
- /**
- * 第一步审核初始化
- * @return type
- */
- public function infoAuditInit()
- {
- return app('json')->success([
- 'all' => (new InfoAudit)->count(),
- 'wait' => (new InfoAudit)->where('status', 0)->count(),
- 'ok' => (new InfoAudit)->where('status', 1)->count(),
- 'no' => (new InfoAudit)->where('status', -1)->count(),
- ]);
- }
- /**
- * 获取第一步审核列表
- * @param Request $request
- */
- public function infoAuditList(Request $request)
- {
- $post = UtilService::getMore(
- [
- ['page', 1],
- ['pageSize', 50],
- ['keyword',''],
- ['mobile',''],
- ['user_mobile',''],
- ['status', ''],
- ['uid', ''],
- ['time',[]],
- ], $request
- );
-
- $data = (new InfoAudit)->getList($post,1);
- return app('json')->success([
- 'list' => $data["list"],
- 'pageCount' => $data["totalCount"],
- 'pageSize' => $data["pageSize"],
- 'page' => $data["page"],
- ]);
- }
- /**
- * 信息认证详情
- * @param Request $request
- */
- public function infoAuditInfo(Request $request){
- $post = UtilService::getMore([
- ['id', '', 'empty', '参数错误'],
- ], $request);
- $data = (new InfoAudit)->getItem($post,1);
- if(empty($data)){
- return app('json')->fail('数据不存在');
- }
- return app('json')->success($data);
- }
- /**
- * 第一步审核处理
- * @param Request $request
- */
- public function infoAuditSub(Request $request)
- {
- $post = UtilService::getMore(
- [
- ['id', '', 'empty', '参数错误'],
- ['mono'],
- ['type', 0],
- ], $request);
- $certData = (new InfoAudit)->where('id', $post['id'])->find();
- if (empty($certData)) {
- return app('json')->fail('数据不存在');
- }
- if ($certData['status']!=0) {
- return app('json')->fail( '当前审核已处理');
- }
- //审核通过
- if ($post['type'] == 1) {
- (new InfoAudit)
- ->where('id', $post['id'])
- ->save([
- 'status' => 1,
- 'admin_mono' => $post['mono'],
- 'admin_time' => time(),
- 'admin_id' => $request->adminInfo['id'],
- ]);
- //更新职称
- (new UserModel)->where("uid",$certData["uid"])->update(["work_type_id"=>$certData["user_work_type_id"]]);
- //绑定初始化模板
- (new UserShowTemplate)->userBindTempInit($certData["uid"]);
- //删除以前的资料
- (new InfoAudit)->where('uid', $certData['uid'])->where("id","<>",$certData["id"])->delete();
- return app('json')->success('操作成功');
- }
- //审核驳回
- if ($post['type'] == -1) {
- if(empty($post['mono'])){
- return app('json')->fail( '请输入驳回理由');
- }
- (new InfoAudit)
- ->where('id', $post['id'])
- ->save([
- 'status' => -1,
- 'admin_mono' => $post['mono'],
- 'admin_time' => time(),
- 'admin_id' => $request->adminInfo['id'],
- ]);
- return app('json')->success('已驳回');
- }
- }
-
- /**
- * 平台认证初始化
- * @return type
- */
- public function typeAuditInit()
- {
- return app('json')->success([
- 'all' => (new TypeAudit)->count(),
- 'wait' => (new TypeAudit)->where('status', 0)->count(),
- 'ok' => (new TypeAudit)->where('status', 1)->count(),
- 'no' => (new TypeAudit)->where('status', -1)->count(),
- ]);
- }
-
- /**
- * 平台认证详情
- * @param Request $request
- */
- public function typeAuditInfo(Request $request){
- $post = UtilService::getMore([
- ['id', '', 'empty', '参数错误'],
- ], $request);
- $data = (new TypeAudit)->getItem($post,1);
- if(empty($data)){
- return app('json')->fail('数据不存在');
- }
- return app('json')->success($data);
- }
- /**
- * 获取平台认证审核列表
- * @param Request $request
- */
- public function typeAuditList(Request $request)
- {
- $post = UtilService::getMore(
- [
- ['page', 1],
- ['pageSize', 50],
- ['keyword',''],
- ['mobile',''],
- ['user_mobile',''],
- ['status', ''],
- ['uid', ''],
- ['time',[]],
- ], $request
- );
-
- $data = (new TypeAudit)->getList($post,1);
- return app('json')->success([
- 'list' => $data["list"],
- 'pageCount' => $data["totalCount"],
- 'pageSize' => $data["pageSize"],
- 'page' => $data["page"],
- ]);
- }
- /**
- * 第一步审核处理
- * @param Request $request
- */
- public function typeAuditSub(Request $request)
- {
- $post = UtilService::getMore(
- [
- ['id', '', 'empty', '参数错误'],
- ['mono'],
- ['type', 0],
- ], $request);
- $certData = (new TypeAudit)->where('id', $post['id'])->find();
- if (empty($certData)) {
- return app('json')->fail('数据不存在');
- }
- if ($certData['status']!=0) {
- return app('json')->fail( '当前审核已处理');
- }
- //审核通过
- if ($post['type'] == 1) {
- (new TypeAudit)
- ->where('id', $post['id'])
- ->save([
- 'status' => 1,
- 'admin_mono' => $post['mono'],
- 'admin_time' => time(),
- 'admin_id' => $request->adminInfo['id'],
- ]);
- //删除以前的资料
- (new TypeAudit)->where('uid', $certData['uid'])->where("id","<>",$certData["id"])->delete();
- return app('json')->success('操作成功');
- }
- //审核驳回
- if ($post['type'] == -1) {
- if(empty($post['mono'])){
- return app('json')->fail( '请输入驳回理由');
- }
- (new TypeAudit)
- ->where('id', $post['id'])
- ->save([
- 'status' => -1,
- 'admin_mono' => $post['mono'],
- 'admin_time' => time(),
- 'admin_id' => $request->adminInfo['id'],
- ]);
- return app('json')->success('已驳回');
- }
- }
-
-
- }
|