mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
perf: 支持通过职位名称搜索成员
This commit is contained in:
parent
396144f3fb
commit
a160b2a471
@ -134,7 +134,9 @@ class DialogController extends AbstractController
|
||||
if (str_contains($key, "@")) {
|
||||
$query->where("email", "like", "%{$key}%");
|
||||
} else {
|
||||
$query->where("nickname", "like", "%{$key}%")->orWhere("pinyin", "like", "%{$key}%");
|
||||
$query->where("nickname", "like", "%{$key}%")
|
||||
->orWhere("pinyin", "like", "%{$key}%")
|
||||
->orWhere("profession", "like", "%{$key}%");
|
||||
}
|
||||
})->orderBy('userid')
|
||||
->take(20 - count($list))
|
||||
|
||||
@ -520,7 +520,8 @@ class UsersController extends AbstractController
|
||||
} else {
|
||||
$builder->where(function($query) use ($keys) {
|
||||
$query->where("nickname", "like", "%{$keys['key']}%")
|
||||
->orWhere("pinyin", "like", "%{$keys['key']}%");
|
||||
->orWhere("pinyin", "like", "%{$keys['key']}%")
|
||||
->orWhere("profession", "like", "%{$keys['key']}%");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@
|
||||
</template>
|
||||
<div class="last-text">
|
||||
<em v-if="formatMsgEmojiDesc(dialog.last_msg)">{{formatMsgEmojiDesc(dialog.last_msg)}}</em>
|
||||
<span>{{$A.getMsgSimpleDesc(dialog.last_msg)}}</span>
|
||||
<span>{{$A.getMsgSimpleDesc(dialog.last_msg) || showProfessionDesc(dialog.dialog_user)}}</span>
|
||||
</div>
|
||||
</template>
|
||||
<div v-if="dialog.silence" class="taskfont last-silence"></div>
|
||||
@ -469,8 +469,13 @@ export default {
|
||||
},
|
||||
|
||||
contactsList() {
|
||||
const {contactsKey} = this;
|
||||
const list = [];
|
||||
this.contactsFilter.some(user => {
|
||||
this.contactsFilter.some(data => {
|
||||
const user = $A.cloneJSON(data);
|
||||
if (contactsKey && $A.strExists(user.profession, contactsKey)) {
|
||||
user.tags.push(user.profession)
|
||||
}
|
||||
let az = user.az ? user.az.toUpperCase() : "#";
|
||||
let item = list.find(item => item.az == az);
|
||||
if (item) {
|
||||
@ -998,6 +1003,13 @@ export default {
|
||||
return null;
|
||||
},
|
||||
|
||||
showProfessionDesc(dialog_user) {
|
||||
if (dialog_user) {
|
||||
return `[${dialog_user.profession}]`
|
||||
}
|
||||
return ''
|
||||
},
|
||||
|
||||
lastMsgReadDone(data) {
|
||||
if ($A.isJson(data)) {
|
||||
const {userid, percentage} = data;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user