Reset date_upd
This commit is contained in:
parent
2cdfbdb833
commit
a09de51ac2
@ -169,9 +169,15 @@ class ContactController extends ContactControllerCore {
|
|||||||
|
|
||||||
if ($contact->customer_service)
|
if ($contact->customer_service)
|
||||||
{
|
{
|
||||||
|
$ctStatusLast = false;
|
||||||
|
|
||||||
if ((int)$id_customer_thread)
|
if ((int)$id_customer_thread)
|
||||||
{
|
{
|
||||||
$ct = new CustomerThread($id_customer_thread);
|
$ct = new CustomerThread($id_customer_thread);
|
||||||
|
|
||||||
|
$ctStatusLast = $ct->status;
|
||||||
|
$ctStatusDate = $ct->date_upd;
|
||||||
|
|
||||||
$ct->status = 'open';
|
$ct->status = 'open';
|
||||||
$ct->id_lang = (int)self::$cookie->id_lang;
|
$ct->id_lang = (int)self::$cookie->id_lang;
|
||||||
$ct->id_contact = (int)($id_contact);
|
$ct->id_contact = (int)($id_contact);
|
||||||
@ -202,6 +208,12 @@ class ContactController extends ContactControllerCore {
|
|||||||
|
|
||||||
if ($ct->id)
|
if ($ct->id)
|
||||||
{
|
{
|
||||||
|
// Update date_upd to the last interesting date
|
||||||
|
if ($ctStatusLast !== false && $ctStatusLast == 'open') {
|
||||||
|
$sql = 'UPDATE `'._DB_PREFIX_.'customer_threads` SET `date_upd` = "'.$ctStatusDate.'" WHERE id_customer_thread='. $ct->id;
|
||||||
|
Db::getInstance()->Execute($sql);
|
||||||
|
}
|
||||||
|
|
||||||
$cm = new CustomerMessage();
|
$cm = new CustomerMessage();
|
||||||
$cm->id_customer_thread = $ct->id;
|
$cm->id_customer_thread = $ct->id;
|
||||||
$cm->message = htmlentities($message, ENT_COMPAT, 'UTF-8');
|
$cm->message = htmlentities($message, ENT_COMPAT, 'UTF-8');
|
||||||
|
Loading…
Reference in New Issue
Block a user