|
@@ -71,7 +71,7 @@ class Msg
|
|
|
$update['emphasis_keyword'] = $emphasis_keyword;
|
|
|
|
|
|
if (!$update['form_id']) {
|
|
|
- $update['form_id'] = $this->getFormId($update['touser']);
|
|
|
+ $update['form_id'] = $this->getFormId($info['project_id'], $update['touser']);
|
|
|
}
|
|
|
|
|
|
$where = array();
|
|
@@ -128,10 +128,10 @@ class Msg
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function getFormId($openid)
|
|
|
+ public function getFormId($project_id, $openid)
|
|
|
{
|
|
|
# 获取一个form_id,取最新的100条,然后随机取
|
|
|
- $info = Dever::db('applet/msg_form')->getAll(array('option_openid' => $openid));
|
|
|
+ $info = Dever::db('applet/msg_form')->getAll(array('option_openid' => $openid, 'option_project_id' => $project_id));
|
|
|
if ($info) {
|
|
|
$key = array_rand($info, 1);
|
|
|
$info = $info[$key];
|