<?php

namespace app\api\controller\company;

use app\common\controller\Apic;
use think\Db;

/**
 * 评价，门店印象
 */
class Comment extends Apic
{
    protected $noNeedLogin = [];
    protected $noNeedRight = '*';

    //门店印象
    public function lists(){
        $field = [
            'cc.*','user.nickname','user.avatar',
        ];
        $list = Db::name('company_comment')->alias('cc')
            ->join('user','cc.user_id = user.id','LEFT')
            ->field($field)->where('cc.company_id',$this->auth->company_id)->autopage()->select();
        $list = list_domain_image($list,['images','avatar']);

        $this->success(1,$list);
    }

    //删除
    public function delete(){
        $id = input('id',0);
        Db::name('company_comment')->where('id',$id)->delete();
        $this->success();
    }



}
