<?php
/*
 * @Descripttion: 
 * @version: 
 * @Author: kangkang
 * @Date: 2020-10-05 16:05:04
 * @LastEditors: kangkang
 * @LastEditTime: 2020-10-14 20:19:36
 */

namespace app\logs\controller;

use app\logs\model\Logs;
use app\logs\model\User;
use fastphp\base\Controller;

class Index extends Controller
{
    public function export()
    {
        $data = json_decode(file_get_contents("php://input"),true);
        if(!$data){
            die;
        }
        die;
        // $logs = new Logs();
        // $logs->add($data);
    }

    //点击客户管理
    public function clickVipInfo(){
        $data = json_decode(file_get_contents("php://input"),true);
        if(!$data){
            die;
        }
        $user = new User();
        $list = json_encode($user->getUserList());
        $data['info'] = $list;
        $data['create_time'] = date('Y-m-d H:i:s',time());
        $logs = new Logs();
        $status = $logs->add($data);
        if($status){
            echo  json_encode(['Code'=>20000,]);
        }
    }

     //点击客户信息产品账号//点击客户更多联系方式//点击客户信息会员价
     public function clickInfo(){
        $data = json_decode(file_get_contents("php://input"),true);
        if(!$data){
            die;
        }
        $user = new User();
        $info = $user->getOne(['id'=>$data['userid']],'LoginCode');
        $data['info'] = $info['LoginCode'];
        $data['create_time'] = date('Y-m-d H:i:s',time());
        unset($data['userid']);
        $logs = new Logs();
        $logs->add($data);
        echo  json_encode(['Code'=>20000,]);
    }

    public function hoveInfo(){
        $data = json_decode(file_get_contents("php://input"),true);
        if(!$data){
            die;
        }
        $data['create_time'] = date('Y-m-d H:i:s',time());
        $logs = new Logs();
        $logs->add($data);
        echo  json_encode(['Code'=>20000,]);
    }
}