* adjust for xuanxuan.

This commit is contained in:
wangyidong
2021-04-30 08:50:22 +08:00
parent 3d6e0158af
commit 107dd03c42
3 changed files with 36 additions and 3 deletions
+1
View File
@@ -122,6 +122,7 @@ zentaoxx:
sed -i 's/commonModel::getLicensePropertyValue/extCommonModel::getLicensePropertyValue/g' zentaoxx/module/im/control.php
sed -i 's/commonModel::getLicensePropertyValue/extCommonModel::getLicensePropertyValue/g' zentaoxx/module/im/model/conference.php
sed -i 's/xxb_/zt_/g' zentaoxx/db/*.sql
echo "ALTER TABLE \`zt_user\` ADD \`pinyin\` varchar(255) NOT NULL DEFAULT '' AFTER \`realname\`;" >> zentaoxx/db/xuanxuan.sql
mkdir zentaoxx/tools; cp tools/cn2tw.php zentaoxx/tools; cd zentaoxx/tools; php cn2tw.php
cp tools/en2de.php zentaoxx/tools; cd zentaoxx/tools; php en2de.php ../
rm -rf zentaoxx/tools
@@ -113,4 +113,36 @@ class xuanxuanIm extends imModel
return $fileID;
}
public function chatAddAction($chatId = '', $action = '', $actorId = '', $result = '', $comment = '')
{
if(!$this->loadModel('action')->checkLogLevel('chat', $action)) return;
$account = $this->dao->select('account')->from(TABLE_USER)->where('id')->eq($actorId)->fetch('account');
$actor = !empty($account) ? $account : '';
$extra = json_encode(array('actorId' => $actorId));
$this->loadModel('action')->create('chat', $chatId, $action, $comment, $extra, $actor);
}
public function userAddAction($user, $actionType, $result, $comment = '', $common = false)
{
if(!zget($this->config->xuanxuan, 'logLevel', 1) && !$common) return;
$account = '';
$userID = 0;
if(is_int($user))
{
$account = $this->dao->select('account')->from(TABLE_USER)->where('id')->eq($user)->fetch('account');
$userID = $user;
}
if(is_string($user))
{
$userID = $this->dao->select('id')->from(TABLE_USER)->where('account')->eq($user)->fetch('id');
$account = $user;
}
$actor = !empty($account) ? $account : '';
$extra = json_encode(array('actorId' => $userID));
$this->loadModel('action')->create('user', $userID, $actionType, $comment, $extra, $actor);
}
}
+3 -3
View File
@@ -21,10 +21,10 @@ public function uploadFile($fileName, $path, $size, $time, $userID, $users, $cha
public function chatAddAction($chatId = '', $action = '', $actorId = '', $result = '', $comment = '')
{
return;
return $this->loadExtension('xuanxuan')->chatAddAction($chatId, $action, $actorId, $result, $comment);
}
public function userAddAction($chatId = '', $action = '', $actorId = '', $result = '', $comment = '')
public function userAddAction($user, $actionType, $result, $comment = '', $common = false)
{
return;
return $this->loadExtension('xuanxuan')->userAddAction($user, $actionType, $result, $comment, $common);
}