<?php
// +----------------------------------------------------------------------
// | WindSNS 国内领先企业级社交开源SNS框架系统
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2028 http://windsns.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 常州微诺信息科技有限公司 http://www.weinuo.net
// +----------------------------------------------------------------------
// | E-mail: open@weinuo.net
// +----------------------------------------------------------------------
namespace app\index\controller;
use app\common\controller\Frontend;
use think\Config;
use think\Hook;
use think\Db;
use think\Request;
class Goodshopcomment extends Frontend
{

    protected $noNeedLogin = ['login', 'mobilelogin', 'register', 'resetpwd', 'changeemail', 'changemobile', 'third'];
    protected $noNeedRight = '*';

    public function _initialize()
    {
        parent::_initialize();
    }
	/**
	 * 协议
	 * @author   Devil
	 * @blog     http://www.weinuo.net
	 * @version  0.0.1
	 * @datetime 2020-03-03
	 */
    public function windsns_goodshopcomment()
    {

        $time = time();
		$paytimess = date('Y-m-d H:i:s',$time);
		$paymenttimes = strtotime($paytimess);
	    $userid = $this->auth->getUserinfo()['user_id'];
	    $shopid  =  input('get.goodshopid'); 
	    $sqinfosid = Db::name('goodshop')->where(['shopid'=>$shopid])->find();
    	$windsnsshopnames =  $sqinfosid['shop_names'];
        $windsns_goodshopcommentadd['shopcomment_uid'] =  $userid; 
	    $windsns_goodshopcommentadd['shopcomment_shopid'] = $shopid; 
	    $windsns_goodshopcommentadd['shopcommentdel'] =  1; 
	    $windsns_goodshopcommentadd['shopcomment'] =  input('post.shopcomment'); 
        $windsns_goodshopcommentadd['shopcommenttimes'] =  $paymenttimes; 
        if(!$windsns_goodshopcommentadd['shopcomment']){
        	 $this->assign('shopid', $shopid);
        	 $this->assign('windsnsshopnames', $windsnsshopnames);
         	return $this->view->fetch('index@goodshop/windsns_goodshopcommentnull');
        }else{
        	$wedid = Db::name('goodshopcomment')->insert($windsns_goodshopcommentadd);
        	 $this->assign('shopid', $shopid);
        	 $this->assign('windsnsshopnames', $windsnsshopnames);
        	return $this->view->fetch('index@goodshop/windsns_goodshopcommentok');
        }

	/**
	 * 协议
	 * @author   Devil
	 * @blog     http://www.weinuo.net
	 * @version  0.0.1
	 * @datetime 2020-03-03
	 */
    }
   
    	









}
