-
+
diff --git a/application/api/controller/Content.php b/application/api/controller/Content.php
index 74b358a..409a3dd 100644
--- a/application/api/controller/Content.php
+++ b/application/api/controller/Content.php
@@ -15,6 +15,7 @@ use app\admin\model\Order;
use app\admin\model\user\Friend;
use think\Model;
use think\Db;
+use fast\Random;
use think\Exception;
/**
* 事件接口
@@ -155,13 +156,32 @@ class Content extends Api
$logModel = new LogModel;
$id = $this->request->post('id');
$post = $this->request->post();
+ $data = $this->model->get($id);
if(isset($post['token']) && !empty($post['token']) && $this->auth->id){
+ $userin = User::get($this->auth->id);
$playinfo = $logModel->where('type',3)->where('content_id',$id)->where('user_id',$this->auth->id)->find();
if(empty($playinfo)){
$this->operaContentneibu(['content_id'=>$id,'type'=>3,'user_id'=>$this->auth->id]);
}
+ $order = Order::where(['content_id'=>$data['id'],'user_id'=>$this->auth->id,'status'=>1])->find();
+ //判断是否是云股东
+ if($userin['is_vip']&&$userin['vipout_time']>time()&&$userin['read_num']>0&&empty($order)){
+ $order['content_id'] = $data['id'];
+ $order['user_id'] = $this->auth->id;
+ $order['order_no'] = "YGD".Random::numeric(15);
+ $order['money'] = 0;
+ $order['createtime'] = date('Y-m-d H:i:s',time());
+ $order['paytime'] = date('Y-m-d H:i:s',time());
+ $order['ispay'] = 1;
+ $order['status'] = 1;
+ $order['paytype'] = "云股东权益";
+ $order['user_money'] = 0;
+ $order['system_money'] = 0;
+ Order::insertGetId($order);
+ $userin->read_num = $userin['read_num']-1;
+ $userin->save();
+ }
}
- $data = $this->model->get($id);
//查询发布人信息
$userinfo = User::get($data['user_id']);
$data['avatar'] = empty($userinfo)?'':$userinfo['avatar'];
@@ -338,11 +358,14 @@ class Content extends Api
}
$insert['title'] = implode(',',array_values($data['where']));
$insert['createtime'] = date("Y-m-d H:i:s",time());
- if(Search::insert($insert)){
- return true;
- }else{
- return false;
+ if(!empty($insert['title'])){
+ if(Search::insert($insert)){
+ return true;
+ }else{
+ return false;
+ }
}
+ return false;
}
public function getsearchlist(){
//获取搜索记录
@@ -353,7 +376,24 @@ class Content extends Api
foreach($list as $key => &$val){
$val['content'] = json_decode($val['content'],true);
}
- $rerurn = ['list'=>$list,'lianxiang'=>$list];
+ //查询联想内容
+ //查询次数多的内容
+ $lianxiang = Search::where('user_id',$uid)->order('createtime desc')->select();
+
+ //获取信息
+ $keyword = array_column($lianxiang,'title');
+ $keyword = array_count_values($keyword);
+
+ arsort($keyword);
+ $top_strings = array_keys($keyword);
+ $top_strings = array_slice($top_strings, 0, 1);
+ $returnlx = Search::where("title","like",$top_strings[0])->order('createtime desc')->limit(0,10)->select();
+
+ foreach($returnlx as $ke => &$va){
+ $va['content'] = json_decode($va['content'],true);
+ }
+
+ $rerurn = ['list'=>$list,'lianxiang'=>$returnlx];
return $this->success('获取成功', $rerurn);
}
public function delsearch(){
diff --git a/application/api/controller/Order.php b/application/api/controller/Order.php
index d872548..ee90a20 100644
--- a/application/api/controller/Order.php
+++ b/application/api/controller/Order.php
@@ -80,11 +80,13 @@ class Order extends Api
if($this->request->isPost()){
$min_user = new \app\admin\model\miniprogram\User;
$amount = $this->request->post('pay_price');
+
//订单号
$out_trade_no = $this->request->post('orderno');
$type = 'wechat';
$method = 'miniapp';
$min_user_info = $min_user->getbyUser_id($this->auth->id);
+ //判断是否是云股东
$openid = $min_user_info['openid'];
if (!$amount || $amount < 0) {
$this->error("支付金额必须大于0");
@@ -152,6 +154,7 @@ class Order extends Api
$order->paytime = date('Y-m-d H:i:s',time());
$order->money = $payamount;
$order->paytype = $paytype;
+ $order->system_money = $payamount;
if($order->type==1){
// 更改用户余额
// 查询事件用户ID
@@ -159,6 +162,8 @@ class Order extends Api
$contentinfo = Content::get($order->content_id);
$dashang = number_format($order->money*0.5, 2, '.', '');
User::money($dashang, $contentinfo['user_id'], $contentinfo->title,1);
+ $order->user_money = $dashang;
+ $order->system_money = $payamount-$dashang;
}
}else if($order->type==2){
$user = User::get($order->user_id);
@@ -166,6 +171,7 @@ class Order extends Api
$user->vipout_time = (int)$user->vipout_time>time()?(time() + 2592000):(int)$user->vipout_time+2592000;
$user->read_num = (int)$user->vipout_time>time()?10:(int)$user->read_num+10;
$user->save();
+ $order->outtime = date("Y-m-d H:i:s",(int)$user->vipout_time>time()?(time() + 2592000):(int)$user->vipout_time+2592000);
}
$order->save();
}
diff --git a/application/api/controller/Systembasic.php b/application/api/controller/Systembasic.php
index b7992b8..d57049e 100644
--- a/application/api/controller/Systembasic.php
+++ b/application/api/controller/Systembasic.php
@@ -47,8 +47,8 @@ class Systembasic extends Api
return $this->success('获取成功',$return);
}
public function infoopen(){
- $info['qq'] = false;
- $info['wechat'] = false;
+ $info['qq'] = true;
+ $info['wechat'] = true;
return $this->success('获取成功',$info);
}
}
\ No newline at end of file
diff --git a/public/assets/js/backend/content.js b/public/assets/js/backend/content.js
index 997f4f1..4496712 100644
--- a/public/assets/js/backend/content.js
+++ b/public/assets/js/backend/content.js
@@ -42,7 +42,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'status', title: '审核状态', searchList: {"0":'待审核',"1":'审核通过',"-1":'驳回'}, formatter: Table.api.formatter.status},
{field: 'updatetime', title: '审核时间', operate:'RANGE', addclass:'datetimerange', autocomplete:false},
- {field: 'content', title: __('Content')},
+ {field: 'content', title: __('Content'), formatter: Table.api.formatter.content},
// {field: 'video', title: __('Video')},
{field: 'main_company', title: __('Main_company'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'user_id', title: __('User_id')},
diff --git a/public/assets/js/backend/content/pinglun.js b/public/assets/js/backend/content/pinglun.js
index e008be8..d828b14 100644
--- a/public/assets/js/backend/content/pinglun.js
+++ b/public/assets/js/backend/content/pinglun.js
@@ -26,11 +26,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
[
{checkbox: true},
{field: 'id', title: __('Id')},
- {field: 'content_id', title: __('Content_id')},
- {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
- {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
- {field: 'status', title: __('Status'), searchList: {"11":__('Status 11')}, formatter: Table.api.formatter.status},
- {field: 'user_id', title: __('User_id')},
+ {field: 'Content_id', title: "标题"},
+ {field: 'type', title: "内容类型"},
+ {field: 'user_id', title: "评论人"},
+ {field: 'content', title: __('Content')},
+ {field: 'createtime', title: "评论时间", operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js
index 4944330..9dc58f1 100644
--- a/public/assets/js/backend/order.js
+++ b/public/assets/js/backend/order.js
@@ -26,16 +26,90 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
[
{checkbox: true},
{field: 'id', title: __('Id')},
- {field: 'content_id', title: __('Content_id')},
- {field: 'user_id', title: __('User_id')},
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
- {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
- {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
- {field: 'type', title: __('Type')},
+ {field: 'money', title: '订单金额(元)'},
+ {field: 'title', title: '内容标题'},
+ {field: 'fabu_user_id', title: '发布者ID'},
+ {field: 'user_id', title: '支付者ID'},
+ {field: 'user_money', title: '平台收入(元)'},
+ {field: 'system_money', title: '用户收入(元)'},
+ {field: 'paytime', title: '支付时间'},
+ {field: 'status', title: "订单状态"},
+ // {field: 'content_id', title: __('Content_id')},
+ // {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+ // {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+ // {field: 'type', title: "订单类型"},
+ // {field: 'ispay', title: "支付状态"},
+ // {field: 'status', title: "订单状态"},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
- ]
+ ],
+ onLoadSuccess: function(data,$element) {
+ console.log(data)
+ $("#paysum").html(data.paysum)
+ $("#systemsum").html(data.systemsum)
+ $("#usersum").html(data.usersum)
+
+ }
+ });
+
+
+ // 为表格绑定事件
+ Table.api.bindevent(table);
+ },
+
+ zanshang: function () {
+ // 初始化表格参数配置
+ Table.api.init({
+ extend: {
+ index_url: 'order/index' + location.search,
+ add_url: 'order/add',
+ edit_url: 'order/edit',
+ del_url: 'order/del',
+ multi_url: 'order/multi',
+ import_url: 'order/import',
+ table: 'order',
+ }
+ });
+
+ var table = $("#table");
+
+ // 初始化表格
+ table.bootstrapTable({
+ url: 'order/zanshang?type=3',
+ pk: 'id',
+ sortName: 'id',
+ columns: [
+ [
+ {checkbox: true},
+ {field: 'id', title: __('Id')},
+ {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
+ {field: 'money', title: '订单金额(元)'},
+ {field: 'title', title: '内容标题'},
+ {field: 'fabu_user_id', title: '发布者ID'},
+ {field: 'user_id', title: '支付者ID'},
+ {field: 'user_money', title: '平台收入(元)'},
+ {field: 'system_money', title: '用户收入(元)'},
+ {field: 'paytime', title: '支付时间'},
+ {field: 'status', title: "订单状态"},
+ // {field: 'content_id', title: __('Content_id')},
+ // {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+ // {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+ // {field: 'type', title: "订单类型"},
+ // {field: 'ispay', title: "支付状态"},
+ // {field: 'status', title: "订单状态"},
+ {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ ]
+ ],
+ onLoadSuccess: function(data,$element) {
+ console.log(data)
+ $("#paysum").html(data.paysum)
+ $("#systemsum").html(data.systemsum)
+ $("#usersum").html(data.usersum)
+
+ }
});
+
// 为表格绑定事件
Table.api.bindevent(table);
diff --git a/public/assets/js/backend/user/vipset.js b/public/assets/js/backend/user/vipset.js
index 157a940..b3b672e 100644
--- a/public/assets/js/backend/user/vipset.js
+++ b/public/assets/js/backend/user/vipset.js
@@ -6,7 +6,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Table.api.init({
extend: {
index_url: 'user/vipset/index' + location.search,
- add_url: 'user/vipset/add',
+ add_url: 'user/vipset/edit/ids/1',
edit_url: 'user/vipset/edit',
del_url: 'user/vipset/del',
multi_url: 'user/vipset/multi',
@@ -19,18 +19,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
// 初始化表格
table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
+ url: 'order/yungudong?type=2',
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
- {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'money', title: __('Money'), operate:'BETWEEN'},
- {field: 'pay_money', title: __('Pay_money'), operate:'BETWEEN'},
- {field: 'status', title: __('Status'), searchList: {"1":__('Status 1')}, formatter: Table.api.formatter.status},
- {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+ {field: 'user_id', title: '用户ID'},
+ {field: 'nickname', title: '用户昵称'},
+ {field: 'money', title: __('Pay_money'), operate:'BETWEEN'},
+ {field: 'createtime', title: '加入时间'},
+ {field: 'outtime', title: '到期时间'},
+ // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
diff --git a/public/assets/js/backend/user/zanshang.js b/public/assets/js/backend/user/zanshang.js
index 0b6a94a..d81e5af 100644
--- a/public/assets/js/backend/user/zanshang.js
+++ b/public/assets/js/backend/user/zanshang.js
@@ -27,9 +27,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'money', title: __('Money'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'content', title: __('Content'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
- {field: 'order', title: __('Order')},
+ {field: 'money', title: "赞赏金额", operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
+ {field: 'order', title: "排序"},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]