static::$baseFile]); } //查询全部 ssh 2019.11.27 public static function getAllList($select, $where, $order = '', $with = '') { $model = self::getModel(); $return = $model->getAllList($select, $where, $order, $with); return $return; } //分页查询 ssh 2019.9.21 public static function getList($select, $where, $order = '', $with = '') { $get = Yii::$app->request->get(); $page = isset($get['page']) ? $get['page'] : 1; Yii::$app->params['page'] = $page; $pageSize = isset($get['pageSize']) && !empty($get['pageSize']) ? $get['pageSize'] : Yii::$app->params['pageSize']; $model = self::getModel(); $return = $model->getList($select, $where, $page, $pageSize, $order, $with); return $return; } //查询指定条数 ssh 2019.11.30 public static function getLimitList($select, $where, $limit = 10, $order = '', $with = '') { $model = self::getModel(); $return = $model->getLimitList($select, $where, $limit, $order, $with); return $return; } public static function add($data, $returnObject = false) { $model = self::getModel(); return $model->add($data, $returnObject); } /** * 批量添加 */ public static function batchAdd($data) { $model = self::getModel(); $model->batchAdd($data); } /** * 根据主键ID删除一条记录 * @param $id * @return false|int the number of rows deleted, or `false` if the deletion is unsuccessful for some reason. * @throws \Throwable * @throws \yii\db\StaleObjectException */ public static function deleteById($id) { $model = self::getModel(); return $model->deleteById($id); } /** *根据条件删除一条或多条记录 */ public static function deleteByCondition($condition) { $model = self::getModel(); $count = $model->deleteByCondition($condition); return $count; } //根据id批量删 ssh 2019.12.7 public static function deleteByIds($ids) { $model = self::getModel(); return $model->deleteByIds($ids); } /** * 根据主键ID更新一条记录 */ public static function updateById($id, $data) { $model = self::getModel(); return $model->updateById($id, $data); } //根据多个主键id更新 ssh 2019.9.3 public static function updateByIds($ids, $data) { $model = self::getModel(); return $model->updateByIds($ids, $data); } /** * 根据条件更新一条或多条记录 */ public static function updateByCondition($condition, $data) { $model = self::getModel(); $count = $model->updateByCondition($condition, $data); return $count; } /** * 根据主键ID查出一条记录 * @param $id * @param bool $returnObject * @param string $field * @return array|\yii\db\ActiveRecord|null */ public static function getById($id, $returnObject = false, $field = '*') { $model = self::getModel(); return $model->getById($id, $returnObject, $field); } //随机取一个 ssh 2020.2.10 public static function getOne($returnObject = false, $order = false, $field = '*') { $model = self::getModel(); return $model->getOne($returnObject, $order, $field); } /** *根据条件查出一条记录 */ public static function getByCondition($condition, $returnObject = false, $order = false, $field = '*') { $model = self::getModel(); return $model->getByCondition($condition, $returnObject, $order, $field); } //是否存在 ssh 2019.8.30 public static function exists($condition) { $model = self::getModel(); return $model->exists($condition); } /** *根据条件查出多条记录 */ public static function getAllByCondition($condition, $order = null, $field = '*', $indexBy = null, $returnObject = false) { $model = self::getModel(); return $model->getAllByCondition($condition, $order, $field, $indexBy, $returnObject); } /** * 根据多个主键ID查询多条记录 */ public static function getByIds($ids, $order = null, $indexBy = null, $field = '*') { $model = self::getModel(); return $model->getByIds($ids, $order, $indexBy, $field); } /** *根据条件查出数量 */ public static function getCount($condition) { $model = self::getModel(); return $model->getCount($condition); } //计数器+1-1 shizq 2019-12-05 public static function counters($counters, $condition, $params = []) { $model = self::getModel(); return $model->counters($counters, $condition, $params); } //根据主键获取被销的信息 ssh 2021.5.18 public static function getLockById($id, $field = '*') { $model = self::getModel(); return $model->getLockById($id, $field); } //求和 public static function sum($condition, $field) { $model = self::getModel(); return $model->sum($condition, $field); } }