1,'delete_time'=>0,'slid_type'=>1])->whereTime('slid_over','>=',time())->select(); Cache::set('slider',$sliders,3600); } return $sliders; } //添加 public function add($data) { $result = $this::save($data); if($result) { return 1; } else { return 'add_error'; } } //文章编辑 public function edit($data) { $slider = $this::find($data['id']); $result = $slider->save($data); if($result) { return 1; } else { return 'edit_error'; } } }