本文整理汇总了PHP中S::tableFields方法的典型用法代码示例。如果您正苦于以下问题:PHP S::tableFields方法的具体用法?PHP S::tableFields怎么用?PHP S::tableFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类S
的用法示例。
在下文中一共展示了S::tableFields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save($q)
{
$lead_id = Std::parseInt($q->get("lead_id"));
$user = S::$user;
$log_id = false;
if ($log_id = $this->saveLog($q, null)) {
$cTable = "custom_" . Std::string($q->get("entry_list_id"));
haxe_Log::trace(_hx_string_or_null($cTable) . " log_id:" . Std::string($log_id), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 162, "className" => "model.QC", "methodName" => "save")));
$primary_id = S::$my->real_escape_string($q->get("primary_id"));
$sql = new StringBuf();
$sql->add("UPDATE " . _hx_string_or_null($cTable) . " SET ");
$cFields = S::tableFields("" . _hx_string_or_null($cTable), null);
haxe_Log::trace("" . _hx_string_or_null($cTable) . " fields:" . _hx_string_or_null($cFields->toString()), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 177, "className" => "model.QC", "methodName" => "save")));
$cFields->remove($primary_id);
$bindTypes = "";
$values2bind = null;
$i = 0;
$dbFieldTypes = php_Lib::hashOfAssociativeArray(php_Lib::associativeArrayOfObject(S::$conf->get("dbFieldTypes")));
$sets = new _hx_array(array());
$_g = 0;
while ($_g < $cFields->length) {
$c = $cFields[$_g];
++$_g;
$val = $q->get($c);
if ($val !== null) {
if (Std::is($val, _hx_qtype("String"))) {
$values2bind[$i++] = $val;
} else {
$values2bind[$i++] = $val[0];
}
$type = $dbFieldTypes->get($c);
if (Util::any2bool($type)) {
$bindTypes .= _hx_string_or_null($type);
} else {
$bindTypes .= "s";
}
$sets->push(_hx_string_or_null($c) . "=?");
unset($type);
}
unset($val, $c);
}
$sql->add($sets->join(","));
$sql->add(" WHERE lead_id=" . _hx_string_rec($lead_id, ""));
$stmt = S::$my->stmt_init();
haxe_Log::trace($sql->b, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 199, "className" => "model.QC", "methodName" => "save")));
$success = $stmt->prepare($sql->b);
if (!$success) {
haxe_Log::trace($stmt->error, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 203, "className" => "model.QC", "methodName" => "save")));
return false;
}
$success = myBindParam($stmt, $values2bind, $bindTypes);
haxe_Log::trace("success:" . Std::string($success), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 207, "className" => "model.QC", "methodName" => "save")));
if ($success) {
$success = $stmt->execute();
if (!$success) {
haxe_Log::trace($stmt->error, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 213, "className" => "model.QC", "methodName" => "save")));
return false;
}
$sql = new StringBuf();
$uFields = model_QC::$vicdial_list_fields;
$uFields->remove($primary_id);
$bindTypes = "";
$values2bind = null;
$i = 0;
$sql->add("UPDATE vicidial_list SET ");
$sets = new _hx_array(array());
$_g1 = 0;
while ($_g1 < $uFields->length) {
$c1 = $uFields[$_g1];
++$_g1;
$val1 = $q->get($c1);
if ($val1 !== null) {
if (Std::is($val1, _hx_qtype("String"))) {
$values2bind[$i++] = $val1;
} else {
$values2bind[$i++] = $val1[0];
}
$type1 = $dbFieldTypes->get($c1);
if (Util::any2bool($type1)) {
$bindTypes .= _hx_string_or_null($type1);
} else {
$bindTypes .= "s";
}
$sets->push(_hx_string_or_null($c1) . "=?");
unset($type1);
}
unset($val1, $c1);
}
$values2bind[$i++] = S::$user;
$bindTypes .= "s";
$sets->push("security_phrase=?");
$values2bind[$i++] = "XX";
$bindTypes .= "s";
$sets->push("state=?");
if (_hx_equal($q->get("status"), "QCOK") || _hx_equal($q->get("status"), "QCBAD")) {
$list_id = 10000;
if (_hx_equal($q->get("status"), "QCOK")) {
$mID = Std::parseInt($q->get("vendor_lead_code"));
if ($mID === null) {
$mID = S::newMemberID();
//.........这里部分代码省略.........
示例2: save
public function save($q)
{
$lead_id = Std::parseInt($q->get("lead_id"));
$res = S::$my->query("INSERT INTO vicidial_lead_log SELECT * FROM (SELECT NULL AS log_id," . _hx_string_rec($lead_id, "") . " AS lead_id,NOW() AS entry_date) AS ll JOIN (SELECT modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM `vicidial_list`WHERE `lead_id`=" . _hx_string_rec($lead_id, "") . ")AS vl", null);
$log_id = S::$my->insert_id;
if ($log_id > 0) {
$cTable = "custom_" . Std::string($q->get("entry_list_id"));
haxe_Log::trace(_hx_string_or_null($cTable) . " log_id:" . _hx_string_rec($log_id, ""), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 110, "className" => "model.QC", "methodName" => "save")));
if ($this->checkOrCreateCustomTable($cTable, null)) {
$cLogTable = _hx_string_or_null($cTable) . "_log";
$res = S::$my->query("INSERT INTO " . _hx_string_or_null($cLogTable) . " SELECT * FROM (SELECT " . _hx_string_rec($log_id, "") . " AS log_id) AS ll JOIN (SELECT * FROM `" . _hx_string_or_null($cTable) . "`WHERE `lead_id`=" . _hx_string_rec($lead_id, "") . ")AS cl", null);
haxe_Log::trace("INSERT INTO " . _hx_string_or_null($cLogTable) . " ..." . _hx_string_or_null(S::$my->error) . "<", _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 117, "className" => "model.QC", "methodName" => "save")));
if (S::$my->error === "") {
$primary_id = S::$my->real_escape_string($q->get("primary_id"));
$sql = new StringBuf();
$sql->add("UPDATE " . _hx_string_or_null($cTable) . " SET ");
$cFields = S::tableFields("" . _hx_string_or_null($cTable), null);
haxe_Log::trace("" . _hx_string_or_null($cTable) . " fields:" . _hx_string_or_null($cFields->toString()), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 125, "className" => "model.QC", "methodName" => "save")));
$cFields->remove($primary_id);
$bindTypes = "";
$values2bind = null;
$i = 0;
$dbFieldTypes = php_Lib::hashOfAssociativeArray(php_Lib::associativeArrayOfObject(S::$conf->get("dbFieldTypes")));
$sets = new _hx_array(array());
$_g = 0;
while ($_g < $cFields->length) {
$c = $cFields[$_g];
++$_g;
$val = $q->get($c);
if ($val !== null) {
if (Std::is($val, _hx_qtype("String"))) {
$values2bind[$i++] = $val;
} else {
$values2bind[$i++] = $val[0];
}
$type = $dbFieldTypes->get($c);
if (Util::any2bool($type)) {
$bindTypes .= _hx_string_or_null($type);
} else {
$bindTypes .= "s";
}
$sets->push(_hx_string_or_null($c) . "=?");
unset($type);
}
unset($val, $c);
}
$sql->add($sets->join(","));
$sql->add(" WHERE lead_id=" . _hx_string_rec($lead_id, ""));
$stmt = S::$my->stmt_init();
haxe_Log::trace($sql->b, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 147, "className" => "model.QC", "methodName" => "save")));
$success = $stmt->prepare($sql->b);
if (!$success) {
haxe_Log::trace($stmt->error, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 151, "className" => "model.QC", "methodName" => "save")));
return false;
}
$success = myBindParam($stmt, $values2bind, $bindTypes);
haxe_Log::trace("success:" . Std::string($success), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 155, "className" => "model.QC", "methodName" => "save")));
if ($success) {
$success = $stmt->execute();
if (!$success) {
haxe_Log::trace($stmt->error, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 161, "className" => "model.QC", "methodName" => "save")));
return false;
}
$sql = new StringBuf();
$uFields = model_QC::$vicdial_list_fields;
$uFields->remove($primary_id);
$bindTypes = "";
$values2bind = null;
$i = 0;
$sql->add("UPDATE vicidial_list SET ");
$sets = new _hx_array(array());
$_g1 = 0;
while ($_g1 < $uFields->length) {
$c1 = $uFields[$_g1];
++$_g1;
$val1 = $q->get($c1);
if ($val1 !== null) {
if (Std::is($val1, _hx_qtype("String"))) {
$values2bind[$i++] = $val1;
} else {
$values2bind[$i++] = $val1[0];
}
$type1 = $dbFieldTypes->get($c1);
if (Util::any2bool($type1)) {
$bindTypes .= _hx_string_or_null($type1);
} else {
$bindTypes .= "s";
}
$sets->push(_hx_string_or_null($c1) . "=?");
unset($type1);
}
unset($val1, $c1);
}
$values2bind[$i++] = S::$user;
$bindTypes .= "s";
$sets->push("security_phrase=?");
if (_hx_equal($q->get("status"), "MITGL")) {
$list_id = 10000;
$mID = Std::parseInt($q->get("vendor_lead_code"));
if ($mID === null) {
//.........这里部分代码省略.........