where($condition)->delete(); } /** * 获取会员标签列表 * @param type $order * @param type $pagesize * @return type */ public function getSnsmembertagList($order, $pagesize) { if ($pagesize) { $tag_list = Db::name('snsmembertag')->order($order)->paginate(['list_rows' => 10, 'query' => request()->param()], false); $this->page_info = $tag_list; return $tag_list->items(); } else { return Db::name('snsmembertag')->order($order)->select()->toArray(); } } /** *增加会员标签 * @param type $data * @return type */ public function addSnsmembertag($data) { return Db::name('snsmembertag')->insert($data);; } /** * 编辑会员标签 * @param type $update * @return type */ public function editSnsmembertag($update) { return $result = Db::name('snsmembertag')->update($update);; } /** * 获取单个会员标签 * @param type $condition * @return type */ public function getOneSnsmembertag($condition) { return Db::name('snsmembertag')->find($condition); } /** * 获取会员标签数 * @param type $condition * @return type */ public function getSnstagmemberCount($condition) { return Db::name('snsmtagmember')->where($condition)->count();; } /** * 获取所属标签会员列表 * @param type $condition * @param type $field * @param type $pagesize * @param type $order * @param type $count * @return type */ public function getSnsmtagmemberList($condition, $field, $pagesize, $order, $count) { if ($pagesize) { $result = Db::name('snsmtagmember')->alias('s')->field($field)->join('member m', 's.member_id=m.member_id', 'LEFT')->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false); $this->page_info = $result; return $result->items(); } else { $result = Db::name('snsmtagmember')->alias('s')->field($field)->join('member m', 's.member_id=m.member_id', 'LEFT')->where($condition)->order($order)->select()->toArray(); return $result; } } /** * 删除所属标签会员 * @param type $condition * @return type */ public function delSnsmtagmember($condition) { return Db::name('snsmtagmember')->where($condition)->delete(); } public function editSnsmtagmember($condition, $update) { return Db::name('snsmtagmember')->where($condition)->update($update); } }