<?php
/*
 本代码由 口号帮 创建
 创建时间 2019-05-06 16:50:44
 技术支持 口号帮
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace App\Http\Controllers\Admin;use App\Models\DistributeTemplate;use Illuminate\Http\Request;use App\Http\Controllers\Controller;class DistributeTemplateController extends Controller{public function index(){return view('admin.channel.distributeTemplate.index');}public function data(Request $request,DistributeTemplate $distributeTemplate){$model=$distributeTemplate->query();$res=$model->orderBy('created_at','desc')->with([])->paginate($request->get('limit',30))->toArray();$O28AC0=array();$O28AC0['code']=0;$O28AC0['msg']='正在请求中...';$O28AC0['count']=$res['total'];$O28AC0['data']=$res['data'];$data=$O28AC0;return response()->json($data);}public function create(){return view('admin.channel.distributeTemplate.create');}public function store(Request $request,DistributeTemplate $distributeTemplate){$data=$request->all();$distributeTemplate->create($data);return redirect()->route('admin.channel.distributeTemplate')->with('status','添加成功！');}public function show($id){}public function edit($id,DistributeTemplate $distributeTemplate){$distribute_template=$distributeTemplate->find($id);return view('admin.channel.distributeTemplate.edit',compact('distribute_template'));}public function update(Request $request,$id){$DistributeTemplate=DistributeTemplate::find($id);$data=$request->all();$O28AC0=array();$arr=$O28AC0;foreach($data['custom_range']as $datum){$arr[]=$datum;$O280=$datum;}$data['custom_range']=json_encode($arr);$DistributeTemplate->update($data);return redirect()->route('admin.channel.distributeTemplate')->with('status','修改成功！');}public function destroy($id){}}
?>