ProjectsLogic.php 1.6 KB
<?php

namespace App\Http\Logic\Aside\Projects;

use App\Http\Logic\Aside\BaseLogic;
use App\Models\Projects\Projects;

/**
 * @remark :谷歌流量系统统计表
 * @class  :ProjectsLogic.php
 * @author :lyh
 * @time   :2023/7/11 9:54
 */
class ProjectsLogic extends BaseLogic
{
    public function __construct()
    {
        parent::__construct();
        $this->param = $this->requestAll;
        $this->model = new Projects();
    }

    /**
     * @remark :获取列表
     * @name   :projectsLists
     * @author :lyh
     * @method :post
     * @time   :2023/7/11 9:56
     */
    public function projectsLists($map,$page,$row,$order = 'id',$filed = ['*']){
        $lists = $this->model->lists($map,$page,$row,$order,$filed);
        return $this->success($lists);
    }

    /**
     * @remark :更新
     * @name   :projectsSave
     * @author :lyh
     * @method :post
     * @time   :2023/7/11 10:05
     */
    public function projectsSave(){
        if(isset($this->param['id']) && !empty($this->param['id'])){
            $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
        }else{
            $rs = $this->model->add($this->param);
        }
        if($rs === false){
            $this->fail('error');
        }
        return $this->success();
    }

    /**
     * @remark :删除
     * @name   :projectsDel
     * @author :lyh
     * @method :post
     * @time   :2023/7/11 10:07
     */
    public function projectsDel(){
        $rs = $this->model->del($this->param);
        if($rs === false){
            $this->fail('error');
        }
        return $this->success();
    }
}