RatingLogic.php 1.4 KB
<?php
/**
 * @remark :
 * @name   :RatingLogic.php
 * @author :lyh
 * @method :post
 * @time   :2024/1/20 14:15
 */

namespace App\Http\Logic\Bside\Scoring;

use App\Http\Logic\Bside\BaseLogic;
use App\Models\Scoring\RatingQuestion;
use App\Models\Scoring\ScoringSystem;

class RatingLogic extends BaseLogic
{
    public function __construct()
    {
        parent::__construct();
        $this->model = new RatingQuestion();
        $this->scoringModel = new ScoringSystem();
        $this->param = $this->requestAll;
    }

    /**
     * @remark :获取详情
     * @name   :getRatingRead
     * @author :lyh
     * @method :post
     * @time   :2024/1/20 14:27
     */
    public function getRatingRead(){
        $data = [
            'company'=>$this->project['company'],
            'mobile'=>$this->project['mobile'],
            'uptime'=>$this->project['uptime'],
            'domain'=>$this->user['domain'],
            'question'=>$this->model->list(),
        ];
        return $this->success($data);
    }

    /**
     * @remark :提交统计
     * @name   :ratingSave
     * @author :lyh
     * @method :post
     * @time   :2024/1/20 14:46
     */
    public function ratingSave(){
        $param = [
            'data'=>$this->param['data'],
            'mobile'=>$this->param['mobile'],
            'project_id'=>$this->user['project_id'],
        ];
        return $this->scoringModel->add($param);
    }
}