zhangzy
2021-03-29 63e1b1d195a7ec2fa3763b9c1527188b5d5be12d
档案
2 files modified
22 ■■■■■ changed files
.env 4 ●●●● patch | view | raw | blame | history
app/Http/Controllers/Api/v1/ArchivesController.php 18 ●●●●● patch | view | raw | blame | history
.env
@@ -16,7 +16,7 @@
#DB_PASSWORD=anniekids@2019
DB_CONNECTION=mysql
DB_HOST=rm-bp19c9r223a1e03a390130.mysql.rds.aliyuncs.com
DB_HOST=rm-bp10kr0f1v52a140rqo.mysql.rds.aliyuncs.com
DB_PORT=3306
DB_DATABASE=anniproject
DB_DATABASE_SYS=annieportal
@@ -31,7 +31,7 @@
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=r-bp1x4t9mjqejtoufej.redis.rds.aliyuncs.com
REDIS_HOST=r-bp1b9ee217c39ef4pd.redis.rds.aliyuncs.com
REDIS_PASSWORD=anniekids@2019
REDIS_USERNAME=r-bp1b9ee217c39ef4
REDIS_PORT=6379
app/Http/Controllers/Api/v1/ArchivesController.php
@@ -46,22 +46,21 @@
        $where = [
            #'classCode' => $request->classCode,
            #'studentId' => $request->studentId,
            'a.isDel' => 0,
            'a.orgId' => $request->orgId,
            'isDel' => 0
        ];
        if(isset($request->classCode) && !empty($request->classCode))
        {
            $where['a.classCode'] = $request->classCode;
            $where['classCode'] = $request->classCode;
        }
        if(isset($request->studentId) && !empty($request->studentId))
        {
            $where['a.studentId'] = $request->studentId;
            $where['studentId'] = $request->studentId;
        }
        $currentPage = $param['page'];
        $perage = $param['pageSize'];
        $limitprame = ($currentPage - 1) * $perage;
        $query = DB::table('anni_archives as a')
            ->select('a.id', 'a.title', 'a.intro', 'a.audioUrl','a.duration', 'a.dates', 'a.classCode', 'a.isExcellent',
            ->select('a.id', 'a.title', 'a.intro', 'a.audioUrl', 'a.dates', 'a.classCode', 'a.isExcellent',
                'a.isPushParent', 'a.createdTime', 'a.studentId', 'a.username', 'a.teacherId', 'u.EnName', 'u.UserAvatar')
            ->leftJoin('annieportal.sys_user as u', 'a.teacherId', '=', 'u.StaffId')
            ->where($where);
@@ -122,9 +121,7 @@
            'classCode' => $request->classCode,
            'title' => $request->title,
            'intro' => $request->intro,
            'orgId' => $request->orgId,
            'audioUrl' => $request->audioUrl,
            'duration' => $request->duration,
            'dates' => $request->date.' '.$request->time,
            'studentId' => $request->studentId,
            'username' => $request->username,
@@ -195,16 +192,15 @@
        {
            return $this->_response([], ResponseCode::PARAM_ERROR, $error);
        }
/*        $idsArr = json_decode($request->fidS, true);
        $idsArr = json_decode($request->fidS, true);
        if(!is_array($idsArr) || count($idsArr) == 0)
        {
            return $this->_response([], ResponseCode::PARAM_ERROR, '参数错误');
        }*/
        }
        $where = [
            'id' => $request->aid,
            'aid' => $request->aid,
            'classCode' => $request->classCode,
            'studentId' => $request->studentId,
            'orgId' => $request->orgId,
        ];
        $res = ArchivesModel::where($where)->delete();
        if(!$res)