57 lines
1.8 KiB
PHP
57 lines
1.8 KiB
PHP
<?php
|
|
/** ZJMall商城系统 - 团队十年电商经验汇集巨献!
|
|
* =========================================================
|
|
* Copy right 2022-2032 四川正今科技有限公司, 保留所有权利。
|
|
* ----------------------------------------------
|
|
* 官方网址: https://www.zjphp.com
|
|
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
|
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布传播。
|
|
* 唯一发布渠道官方颁发授权证书,无纸质授权凭证书视为侵权行为。
|
|
* =========================================================
|
|
*/
|
|
|
|
namespace addon\article\model;
|
|
|
|
use app\model\NewBaseModel;
|
|
class ArticleShareRecord extends NewBaseModel{
|
|
|
|
protected $pk = 'id';
|
|
protected $autoWriteTimestamp = false; // 开启自动时间戳
|
|
protected $deleteTime = false; // 软删除字段
|
|
|
|
/**
|
|
* Common: 文章分享记录
|
|
* Author: wu-hui
|
|
* Time: 2022/11/08 20:39
|
|
* @param $params
|
|
* @return int|string
|
|
*/
|
|
public function addInfo($params){
|
|
$data = [
|
|
'site_id' => $this->site_id,
|
|
'article_id' => $params['article_id'],
|
|
'member_id' => $params['member_id'],
|
|
'share_time' => time(),
|
|
'share_id' => $params['share_id'],
|
|
];
|
|
|
|
return $this->insertGetId($data);
|
|
}
|
|
/**
|
|
* Common: 根据条件 获取统计信息
|
|
* Author: wu-hui
|
|
* Time: 2022/11/08 20:43
|
|
* @param $memberId
|
|
* @param array $where
|
|
* @return int
|
|
* @throws \think\db\exception\DbException
|
|
*/
|
|
public function getCount($memberId,$where = []){
|
|
return $this
|
|
->where(['member_id'=>$memberId])
|
|
->where($where)
|
|
->count();
|
|
}
|
|
|
|
|
|
} |