fixed dmails
This commit is contained in:
parent
730d4d77c5
commit
734c9a2e59
@ -73,7 +73,6 @@ class DmailController extends ApplicationController
|
|||||||
|
|
||||||
public function markAllRead()
|
public function markAllRead()
|
||||||
{
|
{
|
||||||
vpe('a');
|
|
||||||
if ($this->params()->commit == "Yes") {
|
if ($this->params()->commit == "Yes") {
|
||||||
foreach (Dmail::where("to_id = ? and has_seen = false", $this->current_user->id)->take() as $dmail)
|
foreach (Dmail::where("to_id = ? and has_seen = false", $this->current_user->id)->take() as $dmail)
|
||||||
$dmail->updateAttribute('has_seen', true);
|
$dmail->updateAttribute('has_seen', true);
|
||||||
|
@ -71,17 +71,17 @@ class Dmail extends Rails\ActiveRecord\Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setToName($name)
|
public function setToName($name)
|
||||||
{
|
{
|
||||||
if (!$user = User::where(['name' => $name])->first())
|
if (!$user = User::where(['name' => $name])->first())
|
||||||
return;
|
return;
|
||||||
$this->to_id = $user->id;
|
$this->to_id = $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setFromName($name)
|
public function setFromName($name)
|
||||||
{
|
{
|
||||||
if (!$user = User::where(['name' => $name])->first())
|
if (!$user = User::where(['name' => $name])->first())
|
||||||
return;
|
return;
|
||||||
$this->from_id = $user->id;
|
$this->from_id = $user->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user