<?php
/**
 * Created by PhpStorm.
 * User: sicilon_IT
 * Date: 2020/3/3
 * Time: 13:43
 */

namespace app\index\controller;
use app\index\logic\gmemberlogic;
use think\Controller;

class Gmember extends Controller{
    /*
 * 20200302
 * steelxu
 * 标准输出检查找包
 * 测试成功后，再看是做到扩展的基础类，还是
 */
    public function stdout($arr){
        $res_r=array();
        if (empty($arr)){
            $res_r['code']=0;
            $res_r['errmsg']='无数据';
        }else{
            $res_r['code']=200;
            $res_r['resultData']=$arr;
        }

        return $res_r;
    }


    /*
     * 20200303
     * 请求获取班组成员列表
     */
    public function querymemberbyid(){
        $queryinfo = request() -> param();

        $l_gmember=new gmemberlogic();
        $mlist=$l_gmember->getmlistbygid($queryinfo);

        return  json_encode($this->stdout($mlist),320);

    }

    /*
 * 20200303
 * 提交班组成员信息
 */
    public function submitmember(){
        $submitinfo = request() -> param();

        $l_gmember=new gmemberlogic();
        $mid=$l_gmember->savemember($submitinfo);

        return json_encode($this->stdout($mid),320);

    }

    /*
* 20200303
* 批量提交班组成员信息
*/
    public function submitmemberlist(){
        $submitlist = request() -> param();

        $l_gmember=new gmemberlogic();
        $mids=$l_gmember->savememberlist($submitlist);

        return json_encode($this->stdout($mids),320);

    }

}