From 2e824f90755ee88cf7748d5d555246c72b6c0cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E6=96=87=E5=8D=9A?= <9476400@qq.com> Date: Mon, 17 Sep 2018 00:19:36 +0800 Subject: [PATCH] no message --- tests/v3/App/Model/TTLockUser.php | 106 ++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 tests/v3/App/Model/TTLockUser.php diff --git a/tests/v3/App/Model/TTLockUser.php b/tests/v3/App/Model/TTLockUser.php new file mode 100644 index 0000000..efba902 --- /dev/null +++ b/tests/v3/App/Model/TTLockUser.php @@ -0,0 +1,106 @@ +insertGetId( array_merge( $data, [ + 'create_time' => $now_time, + ] ) ); + return $user_id; + } + + /** + * 添加多条 + * @datetime 2017-04-20 15:49:43 + * @author 韩文博 + * @param array $data + * @return boolean + */ + public function addBlsUserAll( $data ) + { + return $this->insertAll( $data ); + } + + /** + * 修改 + * @datetime 2017-04-20 15:49:43 + * @author 韩文博 + * @param array $condition + * @param array $data + * @return boolean + */ + public function editBlsUser( $condition = [], $data = [] ) + { + return $this->update( $data, $condition, true ); + } + + /** + * 删除 + * @datetime 2017-04-20 15:49:43 + * @author 韩文博 + * @param array $condition + * @return boolean + */ + public function delBlsUser( $condition = [] ) + { + return $this->where( $condition )->delete(); + } + + /** + * 计算数量 + * @datetime 2017-04-20 15:49:43 + * @author 韩文博 + * @param array $condition 条件 + * @return int + */ + public function getBlsUserCount( $condition ) + { + return $this->where( $condition )->count(); + } + + + /** + * 用户列表 + * @param array $condition + * @param string $field + * @param number $page + * @param string $order + */ + public function getBlsUserList( $condition = [], $field = '*', $order = 'id desc', $page = "1,10" ) + { + $list = $this->where( $condition )->order( $order )->field( $field )->page( $page )->select(); + return $list ? $list->toArray() : false; + } + + /** + * 获取单个用户信息 + * @datetime 2017-04-20T15:23:09+0800 + * @author 韩文博 + * @param array $condition + * @param string $field + * @param array $extends + * @return array + */ + public function getBlsUserInfo( $condition = [], $field = '*', $extends = [] ) + { + $result = $this->field( $field )->where( $condition )->find(); + $user_info = $result ? $result->toArray() : []; + unset( $user_info['pay_password'] ); + return $user_info; + } + +}