mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改自加函数
This commit is contained in:
parent
5d2e753bcb
commit
505100c3ae
@ -40,11 +40,10 @@ class Goods extends Controller
|
||||
*/
|
||||
public function getGoods()
|
||||
{
|
||||
if ($code = input('code', '')) {
|
||||
$this->app->db->name('ShopGoods')->where(['code' => $code])->update([
|
||||
'num_read' => $this->app->db->raw('num_read+1'),
|
||||
]);
|
||||
}
|
||||
// 更新访问统计
|
||||
$map = $this->_vali(['code.default' => '']);
|
||||
if ($map['code']) $this->app->db->name('ShopGoods')->where($map)->inc('num_read')->update();
|
||||
// 商品数据处理
|
||||
$query = $this->_query('ShopGoods')->like('name,marks,cateids,payment')->equal('code,vip_entry');
|
||||
$result = $query->where(['deleted' => 0, 'status' => 1])->order('sort desc,id desc')->page(true, false, false, 10);
|
||||
if (count($result['list']) > 0) GoodsService::instance()->bindData($result['list']);
|
||||
|
@ -34,9 +34,7 @@ class News extends Controller
|
||||
public function getItem()
|
||||
{
|
||||
if ($code = input('code', '')) {
|
||||
$this->app->db->name('DataNewsItem')->where(['code' => $code])->update([
|
||||
'num_read' => $this->app->db->raw('`num_read`+1'),
|
||||
]);
|
||||
$this->app->db->name('DataNewsItem')->where(['code' => $code])->inc('num_read')->update();
|
||||
if (($uid = input('uid', 0)) > 0) {
|
||||
$data = ['uid' => $uid, 'code' => $code, 'type' => 3, 'status' => 2];
|
||||
$this->app->db->name('DataNewsXCollect')->where($data)->delete();
|
||||
|
Loading…
x
Reference in New Issue
Block a user