12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- /**
- * 手机端买家令牌模型
- */
- namespace app\common\model;
- use think\facade\Db;
- /**
-
- *
-
- *
- * ----------------------------------------------------------------------------
- *
-
- * 数据层模型
- */
- class Mbusertoken extends BaseModel
- {
- /**
- * 查询
- * @access public
- * @author csdeshang
- * @param array $condition 查询条件
- * @return array
- */
- public function getMbusertokenInfo($condition)
- {
- return Db::name('mbusertoken')->where($condition)->find();
- }
- /**
- * 查询
- * @access public
- * @author csdeshang
- * @param type $token 令牌
- * @return type
- */
- public function getMbusertokenInfoByToken($token)
- {
- if (empty($token)) {
- return null;
- }
- return $this->getMbusertokenInfo(array('member_token' => $token));
- }
- /**
- * 编辑
- * @access public
- * @author csdeshang
- * @param type $token 令牌
- * @param type $openId ID
- * @return type
- */
- public function editMemberOpenId($token, $openId)
- {
- return Db::name('mbusertoken')->where(array('member_token' => $token,))->update(array('member_openid' => $openId,));
- }
- /**
- * 新增
- * @access public
- * @author csdeshang
- * @param array $data 参数内容
- * @return bool 布尔类型的返回结果
- */
- public function addMbusertoken($data)
- {
- return Db::name('mbusertoken')->insertGetId($data);
- }
- /**
- * 删除
- * @access public
- * @author csdeshang
- * @param int $condition 条件
- * @return bool 布尔类型的返回结果
- */
- public function delMbusertoken($condition)
- {
- return Db::name('mbusertoken')->where($condition)->delete();
- }
- }
|