<?php

namespace admin\action\sample;


use admin\action\baseAction;
use model\sample\work;

class workAction extends baseAction
{
    public function getList()
    {
        $work = new work();
        $list = $work->list(\mvc::$req['type'],\mvc::$req['c_id'],\mvc::$req['filters']);
        $this->successJson($list);
    }

    public function operation()
    {
        $work = new work();
        $result = $work->operation(\mvc::$req);
        $this->successJson($result);
    }

    public function prolineSet()
    {
        $req = \mvc::$req;
        $work = new work();
        $cate = new \model\pro\cate();
        $pro = new \model\pro\pro();
        $prolines = $work->getProline();
        $cateList =  $cate->getCate($req['cid']);
        $where = [];
        //$proList =  $pro->getRowByWhere($where, ['*']);
        \view::set('prolines', $prolines);
        \view::set('cateList', $cateList);
        \view::put();
    }
    public function getProlineSets($cateId)
    {
        $work = new work();
        $result = $work->getProlineSets($cateId);
        $this->successJson($result);
    }
    public function prolineSetSave($cateId, $type, $uid)
    {
        $work = new work();
        $work->prolineSetSave($cateId, $type, $uid);
        $this->successJson();
    }
}
