|
|
|
@ -78,28 +78,21 @@ class Order_update extends CI_Model {
|
|
|
|
|
* @param [type] $vas_sn [description]
|
|
|
|
|
* @param string $confirminfo [description]
|
|
|
|
|
*/
|
|
|
|
|
public function vendorStatus_update($vas_sn, $confirminfo="")
|
|
|
|
|
public function vendorStatus_update($vas_sn, $lmi_sn, $confirminfo="")
|
|
|
|
|
{
|
|
|
|
|
$sql = "UPDATE VendorArrangeState set VAS_IsConfirm=1,VAS_ConfirmInfo=?+CHAR(10)+VAS_ConfirmInfo
|
|
|
|
|
$sql = "UPDATE VendorArrangeState
|
|
|
|
|
SET VAS_IsConfirm=1
|
|
|
|
|
,VAS_ConfirmInfo=?
|
|
|
|
|
,VAS_ConfirmTime=getdate()
|
|
|
|
|
,VAS_ConfirmSN=?
|
|
|
|
|
WHERE VAS_SN=?";
|
|
|
|
|
$query = $this->HT->query($sql, array($confirminfo, $vas_sn));
|
|
|
|
|
return $query;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function SendMail($fromName, $fromEmail, $toName, $toEmail, $subject, $body) {
|
|
|
|
|
$sql = "INSERT INTO Email_AutomaticSend \n"
|
|
|
|
|
. " ( \n"
|
|
|
|
|
. " M_ReplyToName, M_ReplyToEmail, M_ToName, M_ToEmail, M_Title, M_Body, M_Web, \n"
|
|
|
|
|
. " M_FromName, M_State \n"
|
|
|
|
|
. " ) \n"
|
|
|
|
|
. "VALUES \n"
|
|
|
|
|
. " ( \n"
|
|
|
|
|
. " ?, ?, ?, ?, ?, N?, ?, ?, 0 \n"
|
|
|
|
|
. " ) ";
|
|
|
|
|
$query = $this->HT->query($sql,
|
|
|
|
|
array(substr($fromName, 0, 127), $fromEmail, substr($toName, 0, 127), $toEmail, $subject, $body, $this->config->item('Site_Code'), $this->config->item('Site_SenderName'))
|
|
|
|
|
);
|
|
|
|
|
return $query;
|
|
|
|
|
$query = $this->HT->query($sql, array($confirminfo, $lmi_sn, $vas_sn));
|
|
|
|
|
// affected_rows() doesn't work with the 'sqlsrv' driver in CI2
|
|
|
|
|
// The solution: Upgrade to the latest CodeIgniter 3.0.x version
|
|
|
|
|
$ssql = "SELECT 1 as 'exist' from VendorArrangeState where VAS_IsConfirm=1 and VAS_SN=? ";
|
|
|
|
|
$squery = $this->HT->query($ssql, array($vas_sn));
|
|
|
|
|
$ret = $squery->result();
|
|
|
|
|
return !empty($ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|