在写接口的时候,有的参数需要合并成一个数组
如上,需要把选中的合并到上边的数组里边去
达到如上效果
实现代码如下
public function doPagecourseInfo()
{
global $_W, $_GPC;
$uniacid = $_W['uniacid'];
$id = $_GPC['id'];
$course = pdo_fetch("select * from ".tablename('yzpx_sun_course')." where `uniacid`='$uniacid' and id='$id'");
// $common=pdo_getall('yzpx_sun_news', array('uniacid' => $_W['uniacid'],'id'=>$id));
$course['createtime'] = date('y-m-d', $course['createtime']);
$lesson = pdo_fetchcolumn("select count(*) from " . tablename("yzpx_sun_lesson") ."where couid =".$id);
//将lesson追加给数组course
$course['lesson']=$lesson;
return $this->result(0, 'success', $course);
}