mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-25 19:06:38 +08:00
修改自加函数
This commit is contained in:
parent
5d2e753bcb
commit
505100c3ae
@ -40,11 +40,10 @@ class Goods extends Controller
|
|||||||
*/
|
*/
|
||||||
public function getGoods()
|
public function getGoods()
|
||||||
{
|
{
|
||||||
if ($code = input('code', '')) {
|
// 更新访问统计
|
||||||
$this->app->db->name('ShopGoods')->where(['code' => $code])->update([
|
$map = $this->_vali(['code.default' => '']);
|
||||||
'num_read' => $this->app->db->raw('num_read+1'),
|
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');
|
$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);
|
$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']);
|
if (count($result['list']) > 0) GoodsService::instance()->bindData($result['list']);
|
||||||
|
@ -34,9 +34,7 @@ class News extends Controller
|
|||||||
public function getItem()
|
public function getItem()
|
||||||
{
|
{
|
||||||
if ($code = input('code', '')) {
|
if ($code = input('code', '')) {
|
||||||
$this->app->db->name('DataNewsItem')->where(['code' => $code])->update([
|
$this->app->db->name('DataNewsItem')->where(['code' => $code])->inc('num_read')->update();
|
||||||
'num_read' => $this->app->db->raw('`num_read`+1'),
|
|
||||||
]);
|
|
||||||
if (($uid = input('uid', 0)) > 0) {
|
if (($uid = input('uid', 0)) > 0) {
|
||||||
$data = ['uid' => $uid, 'code' => $code, 'type' => 3, 'status' => 2];
|
$data = ['uid' => $uid, 'code' => $code, 'type' => 3, 'status' => 2];
|
||||||
$this->app->db->name('DataNewsXCollect')->where($data)->delete();
|
$this->app->db->name('DataNewsXCollect')->where($data)->delete();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user