You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/app/common/model/invite/InviteConfig.php

52 lines
1002 B

10 months ago
<?php
namespace app\common\model\invite;
use cores\BaseModel;
class InviteConfig extends BaseModel
{
// 定义表名
protected $name = 'invite_config';
// 定义主键
protected $pk = 'id';
/**
* @notes:编辑
* @param $data
* @return bool
* @author: wanghousheng
*/
public function edit($data): bool
{
if ($this->where(['store_id' => self::$storeId])->exists()) {
return $this->save($data) !== false;
}
$data['store_id'] = self::$storeId;
return $this->save($data);
}
/**
* @notes:新增
* @param $data
* @return bool
* @author: wanghousheng
*/
public function add($data): bool
{
$data['store_id'] = self::$storeId;
return $this->save($data);
}
/**
* 详情
* @param array $where
* @return static|array|null
*/
public static function detail(array $where = [])
{
return self::get($where);
}
}