1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- /**
- * MemInvitedLogModel.php UTF-8
- *
- *
- * @date : 2018/8/17 15:48
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HuoMP 1.0
- */
- namespace huomp\model\member;
- use huomp\model\common\CommonModel;
- class MemInvitedLogModel extends CommonModel {
- protected $table = 'mp_mem_invited_log';
- // 开启自动写入时间戳字段
- protected $autoWriteTimestamp = true;
- /**
- * 添加数据
- *
- * @param $data
- *
- * @return bool
- */
- public function addData($data) {
- if (empty($data)) {
- return false;
- }
- $_data = $data;
- $_obj = self::create($_data, true);
- if ($_obj) {
- return true;
- }
- return false;
- }
- /**
- * 更新数据
- *
- * @param array $data 数据
- * @param int $id ID
- *
- * @return bool
- */
- public function updateData($data, $id) {
- $_map['id'] = $id;
- $_data = $data;
- $_rs = self::update($_data, $_map, true);
- if (false == $_rs) {
- return false;
- }
- return true;
- }
- public function getInfoByParentMemIdAndMemId($parent_mem_id, $mem_id) {
- $_map['parent_mem_id'] = $parent_mem_id;
- $_map['mem_id'] = $mem_id;
- $_info = $this->where($_map)->find();
- if (false === $_info) {
- return false;
- }
- if (is_object($_info)) {
- return $_info->toArray();
- } else {
- return $_info;
- }
- }
- }
|