@@ -225,6 +225,9 @@ class Api extends Core
$data['func'] = $this->getFunc();
+
+ # 更新阅读数
+ Dever::db('collection/info')->addView(array('where_id' => $this->id));
return $data;
}
@@ -128,5 +128,18 @@ return array
'num' => array('yes', '-='),
),
+ # 查看数量
+ 'total' => array
+ (
+ # 匹配的正则或函数 选填项
+ 'option' => array
+ 'info_id' => 'yes',
+ //'state' => 1,
+ ),
+ 'type' => 'one',
+ 'col' => 'sum(total) as total',
);
@@ -142,6 +142,10 @@ class Ticket
Dever::load('collection/lib/ranking')->up($order['uid'], $order['info_id'], 1, $order['buy_num']);
+ # 更新购买数
+ $total = Dever::db('user/ticket')->total(array('info_id' => $order['info_id']));
+ Dever::db('collection/info')->update(array('num_buy' => $total['total'], 'where_id' => $order['info_id']));
# 增加积分
if ($order['parent_uid'] > 0) {
$uid = $order['parent_uid'] . '_' . $order['uid'];