public function sportitemgAdd()
 {
     //trainingplan_base_id
     $trainingplan_base_id = isset($_POST['trainingplan_base_id']) ? trim($_POST['trainingplan_base_id']) : null;
     //sportitem_base_id
     $sportitem_base_id = isset($_POST['sportitem_base_id']) ? trim($_POST['sportitem_base_id']) : null;
     //count
     $count = isset($_POST['acount']) ? trim($_POST['acount']) : null;
     //groupcount
     $groupcount = isset($_POST['agroupcount']) ? trim($_POST['agroupcount']) : null;
     //agrouptype
     $grouptype = isset($_POST['agrouptype']) ? trim($_POST['agrouptype']) : null;
     //$sportitem_base_idArray = explode(',', $sportitem_base_id);
     //addsort
     $sort = isset($_POST['addsort']) ? trim($_POST['addsort']) : null;
     $jsondata = array();
     //判断动作是否添加过
     $cp = new CommonPRM();
     $btbTrainingplanSportitemgroupDetailPRM = new BtbTrainingplanSportitemgroupDetailPRM();
     $btbTrainingplanSportitemgroupDetailPRM->trainingplan_base_id = $trainingplan_base_id;
     $btbTrainingplanSportitemgroupDetailPRM->sportitem_base_id = $sportitem_base_id;
     $btbTrainingplanSportitemgroupDetailPRM->sort = $sort;
     $list = BtbTrainingplanSportitemgroupDetailBLL::getTrainingplanSportitemgroupDetailList($cp, $btbTrainingplanSportitemgroupDetailPRM);
     if (count($list) > 0) {
         //动作已经添加过
         //$flag = -1;
         $jsondata['code'] = -1;
         $jsondata['msg'] = '动作已经添加过,不能重复添加';
     } else {
         $sportitemData = array();
         $sportitemData['trainingplan_base_id'] = $trainingplan_base_id;
         $sportitemData['sportitem_base_id'] = $sportitem_base_id;
         $sportitemData['count'] = $count;
         $sportitemData['groupcount'] = $groupcount;
         $sportitemData['grouptype'] = $grouptype;
         $sportitemData['sort'] = $sort;
         $rows = BtbTrainingplanSportitemgroupDetailBLL::btbTrainingplanSportitemgroupDetailInsert($sportitemData);
         if ($rows > 0) {
             //动作组添加成功
             //$flag = 1;
             $jsondata['code'] = 1;
             $jsondata['msg'] = '动作组添加成功';
         } else {
             //动作组添加失败
             //$flag = 0;
             $jsondata['code'] = -2;
             $jsondata['msg'] = '动作组添加失败';
         }
     }
     //$this->ajaxReturn($flag);
     $this->ajaxReturn($jsondata);
 }