Comment.php 840 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\api\controller\company;
  3. use app\common\controller\Apic;
  4. use think\Db;
  5. /**
  6. * 评价,门店印象
  7. */
  8. class Comment extends Apic
  9. {
  10. protected $noNeedLogin = [];
  11. protected $noNeedRight = '*';
  12. //门店印象
  13. public function lists(){
  14. $field = [
  15. 'cc.*','user.nickname','user.avatar',
  16. ];
  17. $list = Db::name('company_comment')->alias('cc')
  18. ->join('user','cc.user_id = user.id','LEFT')
  19. ->field($field)->where('cc.company_id',$this->auth->company_id)->autopage()->select();
  20. $list = list_domain_image($list,['images','avatar']);
  21. $this->success(1,$list);
  22. }
  23. //删除
  24. public function delete(){
  25. $id = input('id',0);
  26. Db::name('company_comment')->where('id',$id)->delete();
  27. $this->success();
  28. }
  29. }