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