RadarScore.php 831 字节
<?php

namespace app\common\model;

use think\Model;

class RadarScore extends Model
{

    // 表名
    protected $name = 'radar_score';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    // 追加属性
    protected $append = [

    ];

    public function getRadar($cid,$sid){
        $list = collection($this->whereIn('campus_ids',$cid)->where('study_id',$sid)->field('radar_id,score')->select())->toArray();
        $value = [];
        $res = [];
        foreach ($list as $v){
            $value[] = \db('radar')->where('id',$v['radar_id'])->value('title');
            $res[] = $v['score'];
        }
        dump($res);
        halt($value);
        return $value;
    }

}