技术笔记
TP5.1 DB查询追加字段
 moons   2020-08-29 17:13:54   261
专栏分类: PHP
        public function getList($map,$order='create_time desc')
        {
            $data_list = Db::name('companys')
                ->alias('c')
                ->json(['admin_user'=>'a'], 'a.id=c.seller_id')
                ->where($map)
                ->order($order)
                ->paginate();
            
            foreach ($data_list as $key => &$value) {
                $value['track_logs'] = '【跟单记录】';
                $data_list[$key] = $value;
            }
            return $data_list;
        }


或者是

    $data_list = $this->curr_model->list($map,$order);
    $items = $data_list->items();
    foreach ($items as $key => &$value) {           
    $value['pay_logs']='【付款记录】';
    $value['product_list']='【产品列表】';
    }
Copyright © mos360.cn By Moons Soft Studio 百度统计