作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

课程购买量

... ... @@ -67,7 +67,7 @@ class Course extends Backend
->select();
foreach ($list as $row) {
$row->visible(['id','title','cover','current_price','original_price','study_num_rate','study_num_real','teacher_avatar','teacher_name','teacher_desc','is_top','pay_times']);
$row->visible(['id','title','cover','current_price','original_price','study_num_rate','study_num_real','teacher_avatar','teacher_name','teacher_desc','is_top','pay_num']);
}
$list = collection($list)->toArray();
... ...
... ... @@ -19,5 +19,5 @@ return [
'Top_time' => '置顶时间',
'Createtime' => '创建时间',
'Updatetime' => '修改时间',
'Pay_times' => '购买次数'
'Pay_num' => '购买量'
];
... ...
... ... @@ -45,7 +45,7 @@ class Notify extends Api
if($order && $order['pay_status'] != '1'){
$order->save(['pay_status'=>'1','pay_time'=>time()]);
// 购买次数加1
Db::name('mobile_course')->where('id',$order['course_id'])->setInc('pay_times');
Db::name('mobile_course')->where('id',$order['course_id'])->setInc('pay_num');
}
} catch (Exception $e) {
}
... ... @@ -72,6 +72,8 @@ class Notify extends Api
$order = SecretOrder::get(['order_sn'=>$out_trade_no,'pay_price'=>$payamount,'pay_type'=>$paytype]);
if($order && $order['pay_status'] != '1'){
$order->save(['pay_status'=>'1','pay_time'=>time()]);
// 购买次数加1
Db::name('mobile_secret')->where('id',$order['course_id'])->setInc('pay_num');
}
} catch (Exception $e) {
}
... ...
... ... @@ -35,7 +35,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'teacher_name', title: __('Teacher_name')},
{field: 'teacher_desc', title: __('Teacher_desc')},
// {field: 'is_top', title: __('Is_top'), searchList: {"0":__('Is_top 0'),"1":__('Is_top 1')}, formatter: Table.api.formatter.toggle},
{field: 'pay_times', title: __('Pay_times')},
{field: 'pay_num', title: __('Pay_num')},
//操作栏,默认有编辑、删除或排序按钮,可自定义配置buttons来扩展按钮
{
field: 'operate',
... ... @@ -47,7 +47,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
name: 'top',
text: '置顶',
title: '置顶',
classname: 'btn btn-xs btn-danger btn-ajax',
classname: 'btn btn-xs btn-primary btn-ajax',
icon: 'fa fa-long-arrow-up',
url: 'mobile/course/course/top?course_id={id}&is_top=1',
visible: function (row) {
... ... @@ -63,7 +63,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
name: 'top',
text: '取消置顶',
title: '取消置顶',
classname: 'btn btn-xs btn-primary btn-ajax',
classname: 'btn btn-xs btn-danger btn-ajax',
icon: 'fa fa-long-arrow-down',
url: 'mobile/course/course/top?course_id={id}&is_top=0',
visible: function (row) {
... ...