1234567891011121314151617181920212223242526 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- class Feedback extends Base
- {
- public function add(){
- $data = [
- 'content'=>input('content','','trim'),
- 'image'=>input('image','','trim'),
- 'status'=>input('status',0),
- 'create_time'=>date('Y-m-d H:i:s'),
- 'user_id'=>$this->userId,
- ];
- if(!$data['content'] && empty($data['content'])){
- HelpHander::error('内容不能为空');
- }
- $res = db('feedback')->insert($data);
- if($res){
- HelpHander::success([],'操作成功');
- }else{
- HelpHander::error('操作失败');
- }
- }
- }
|