<commit_before><?php
/**
 * Created by sunny.
 * User: sunny
 * For Darling
 * Date: 2016/12/5
 * Time: 15:04
 */
namespace app\api\controller;

class Blog extends Base{
    public function index(){
        $count=model("Article")->count();
        $listrows=config("LISTROWS")?config("LISTROWS"):10;
        $page=new \sunny\Page($count,$listrows);
        $articles=model("Article")->field("views,title,pics,description,create_time")->limit($page->firstRow,$page->listRows)->select();
        if(!empty($articles)) {
            foreach ($articles as $k => $val) {
                if (!empty($val['pics'])) {
                    $where = "id IN (" . $val['pics'] . ")";
                    $files = model("File")->where($where)->select();
                    $articles[$k]['picsdetail'] = $files;
                }
            }
            $data=array(
                "articles"=>$articles,
                "nowpage"=>$page->getNowPage()
            );
            $this->ajaxReturn($data,1,"获取数据成功！");<commit_msg>加上真实url路径<commit_after><?php
/**
 * Created by sunny.
 * User: sunny
 * For Darling
 * Date: 2016/12/5
 * Time: 15:04
 */
namespace app\api\controller;

class Blog extends Base{
    public function index(){
        $count=model("Article")->count();
        $listrows=config("LISTROWS")?config("LISTROWS"):10;
        $page=new \sunny\Page($count,$listrows);
        $articles=model("Article")->field("views,title,pics,description,create_time")->limit($page->firstRow,$page->listRows)->select();
        if(!empty($articles)) {
            foreach ($articles as $k => $val) {
                if (!empty($val['pics'])) {
                    $where = "id IN (" . $val['pics'] . ")";
                    $files = model("File")->where($where)->select();
                    foreach($files as $key=>$v){
                        $files[$k]["realpath"]="http://kebenxiaoming.info/uploads/".$v['savepath'];
                    }
                    $articles[$k]['picsdetail'] = $files;
                }
            }
            $data=array(
                "articles"=>$articles,
                "nowpage"=>$page->getNowPage()
            );
            $this->ajaxReturn($data,1,"获取数据成功！");
{'fraction_non_alphanumeric': 0.19473445301861098, 'fraction_numerical': 0.01270994098955969, 'mean_word_length': 2.061111111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5982958', 'n_tokens_mistral': 703, 'n_tokens_neox': 656, 'n_words': 95}