init
This commit is contained in:
37
app/id/controller/Clicksum.php
Executable file
37
app/id/controller/Clicksum.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: ORICO
|
||||
* Date: 2018-12-10
|
||||
* Time: 13:48
|
||||
*/
|
||||
namespace app\id\controller;
|
||||
|
||||
use think\Controller;
|
||||
use think\Session;
|
||||
|
||||
class ClickSum extends Controller {
|
||||
|
||||
public function add_click() {
|
||||
$data = $this->request->post();
|
||||
// tiaoshi($data);die;
|
||||
if (empty($data) || !is_array($data)) {
|
||||
return $this->json(-1, '数据错误');
|
||||
}
|
||||
|
||||
$insert_data = [
|
||||
'content_id' => $data['content_id'],
|
||||
'type' => $data['type'],
|
||||
'customer_id' => $data['customer_id'],
|
||||
'country_code' => $data['country_code'],
|
||||
'url' => $data['url'],
|
||||
'click_ip' => get_ip(),
|
||||
'create_time' => date('Y-m-d H:i:s')
|
||||
];
|
||||
|
||||
model('click_sum')->insert($insert_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user