|
@@ -26,6 +26,22 @@ class Greet extends Api
|
|
|
$this->error(__('Invalid parameters'));
|
|
|
}
|
|
|
|
|
|
+ //打招呼内容
|
|
|
+ $greet = null;
|
|
|
+ if($this->auth->gender == 0){
|
|
|
+ $where['user_id'] = $this->auth->id;
|
|
|
+ $greet = Db::name('user_greet_content')->where($where)->orderRaw('rand()')->find();
|
|
|
+ if(empty($greet)){
|
|
|
+ $this->error('先设置打招呼内容吧');
|
|
|
+ }
|
|
|
+ if(!empty($greet) && $greet['type'] != 0){
|
|
|
+ $greet['content'] = one_domain_image($greet['content']);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $greet = Db::name('user_greet_boy')->orderRaw('rand()')->find();
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
$map = [];
|
|
|
foreach($other_uids as $key => $other_uid){
|
|
|
$map[] = [
|
|
@@ -51,17 +67,6 @@ class Greet extends Api
|
|
|
}
|
|
|
Db::commit();
|
|
|
|
|
|
- $greet = null;
|
|
|
- if($this->auth->gender == 0){
|
|
|
- $where['user_id'] = $this->auth->id;
|
|
|
- $greet = Db::name('user_greet_content')->where($where)->orderRaw('rand()')->find();
|
|
|
- if(!empty($greet) && $greet['type'] != 0){
|
|
|
- $greet['content'] = one_domain_image($greet['content']);
|
|
|
- }
|
|
|
- }else{
|
|
|
- $greet = Db::name('user_greet_boy')->orderRaw('rand()')->find();
|
|
|
- }
|
|
|
-
|
|
|
$rs = [
|
|
|
'gender' => $this->auth->gender,
|
|
|
'greet' => $greet,
|