Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

孙龙 / note-library

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit bb31d074 authored 2 years ago by 孙龙's avatar 孙龙
Browse files
Options
  • _('Browse Files')
  • Download
  • Email Patches
  • Plain Diff

标签

parent 7919aef4
Hide whitespace changes
Inline Side-by-side
Showing with 34 additions and 0 deletions
  • app/Http/Controllers/ApiController.php
  • app/Http/routes.php
app/Http/Controllers/ApiController.php 0 → 100644
View file @ bb31d074
<?php
namespace App\Http\Controllers;
use App\Model\TemplateExtendModel;
Class ApiController extends Controller
{
public function getUserLabels(){
$list = \DB::connection("label")->table("template_list")->where("template_list.status",1)->leftJoin("template_extend","template_list.id","=","template_extend.template_id")->select("template_list.id","template_list.template_name","template_extend.html","template_extend.attribute")->get();
$list = collect($list)->toArray();
$arr = [];
foreach($list as $k=>$item){
$arr[$k]["template_id"] = $item->id;
$arr[$k]["template_name"] = $item->template_name;
$arr[$k]["html"] = $item->html;
$arr[$k]["attribute"] = $item->attribute;
}
return ['code'=>0, 'count'=>count($arr),'data'=>$arr];
}
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
app/Http/routes.php
View file @ bb31d074
......@@ -28,6 +28,8 @@ Route::pattern('roleId', '[0-9]+');
|
*/
Route::get('/api/get_user_labels', 'ApiController@getUserLabels');
Route::group(['middleware' => 'web'], function () {
Route::get('/', 'WebController@index');
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment