TP3.2join查询
$count = $this->model->table('stat_user_log')->where($map)->count();
$page = $this->page($count);
$this->Page = $page->show();
//echo "sql:". $this->model->getLastSql();
$data=$this->model->table('stat_user_log A')//主表
->join('stat_lose_user U ON A.ymd=U.ymd',"LEFT") //附表 join方式
->field('A.ymd,sum(A.acc_add) as acc_add,sum(A.acc_active) as acc_active,sum(A.acc_num) as acc_num') //关键字段
->where($map) //条件
->limit($page->firstRow.",".$page->listRows) //分段
->order('A.ymd desc') //排序
->group("A.ymd") //分组方式
->select();