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/store/model/user/Identity.php

60 lines
1.3 KiB

<?php
namespace app\store\model\user;
use app\common\model\user\Identity as BaseIdentity;
use think\Collection;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
class Identity extends BaseIdentity
{
/**
* @notes:获取全部记录
* @param array $where
* @return Identity[]|array|Collection
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
* @author: wanghousheng
*/
public function getList(array $where)
{
return $this->where($where)->select();
}
/**
* @notes:新增
* @param $data
* @return bool
* @author: wanghousheng
*/
public function add($data): bool
{
$data['store_id'] = self::$storeId;
return $this->save($data);
}
/**
* @notes:编辑
* @param $data
* @return bool
* @author: wanghousheng
*/
public function edit($data): bool
{
return $this->save($data) !== false;
}
/**
* @notes:删除
* @param array $IdentityId
* @return bool
* @author: wanghousheng
*/
public function remove(array $IdentityId): bool
{
return static::whereIn('identity_id', $IdentityId)->delete();
}
}