• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP gen_uuid函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中gen_uuid函数的典型用法代码示例。如果您正苦于以下问题:PHP gen_uuid函数的具体用法?PHP gen_uuid怎么用?PHP gen_uuid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了gen_uuid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: save

 function save($id, $account)
 {
     // Update ....
     if (!$account['isNew']) {
         $this->db->update('person', ["firstname" => $account['firstname'], "lastname" => $account['lastname']], "id = '{$id}'");
         $this->db->update('accountrole', ["role" => $account['role']], "accountid = '{$id}'");
         if (isset($account['password']) && strlen($account['password']) > 5) {
             $this->db->update('account', ["password" => md5($account['password'])], "id = '{$id}'");
         } else {
             $this->latestErr = "Password didn't match or shoter than 5 characters.";
             return false;
         }
     } else {
         $username = $account['username'];
         $this->db->from('account');
         $this->db->where('username', $username);
         if (count($this->db->get()->result())) {
             $this->latestErr = "Email has already taken.";
             return false;
         }
         $this->db->insert('account', buildBaseParam(["id" => $id, "username" => $account['username'], "password" => md5($account['password']), "status" => 0], $id));
         $this->db->insert('person', buildBaseParam(["id" => $id, "firstname" => $account['firstname'], "lastname" => $account['lastname']], $id));
         $this->db->insert('accountrole', buildBaseParam(["id" => gen_uuid(), "accountid" => $id, "role" => strtolower($account['role'])], $id));
     }
     return true;
 }
开发者ID:WangYinXing,项目名称:ce-admin,代码行数:26,代码来源:Mdl_Accounts.php


示例2: initSession

	private function initSession(){
		// init a session id if we don't already have one
		if(!isset($_SESSION["uuid"])){
			// all our access will be through this uuid
			$_SESSION["uuid"] = gen_uuid();
		}
	}
开发者ID:sdytrych,项目名称:drivesafetogether,代码行数:7,代码来源:class.EasyApp.php


示例3: submit_data_to_google

function submit_data_to_google($order_data, $content_data, $order_source)
{
    // Формирование данных для аналитики
    $gaurl = 'https://ssl.google-analytics.com/collect';
    // https://developers.google.com/analytics/devguides/collection/protocol/v1/reference#transport
    $gaid = '';
    // Идентификатор GA
    $gav = '1';
    // Версия GA
    $gasitename = '';
    // Название сайта
    // Список параметров https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#
    $cid = gen_uuid();
    // Client ID
    $uid = gen_uuid();
    // User ID
    $cn = '';
    // Campaign Name
    $cs = '';
    // Campaign Source
    $cm = '';
    // Campaign Medium
    // https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#in
    $data_transaction = array('v' => $gav, 'tid' => $gaid, 'cid' => $cid, 'uid' => $uid, 'cn' => $cn, 'cs' => $cs, 'cm' => $cm, 't' => 'transaction', 'ti' => '', 'ta' => $gasitename, 'tr' => '', 'ts' => '', 'tt' => '');
    $data_item = array('v' => $gav, 'tid' => $gaid, 'cid' => $cid, 'uid' => $uid, 'cn' => $cn, 'cs' => $cs, 'cm' => $cm, 't' => 'item', 'ti' => '', 'ic' => '', 'in' => '', 'ip' => '', 'iq' => '', 'iv' => 'tea');
    // Выполнить запрос к GA
    $result_transaction = execute_request_to_google($data_transaction, $gaurl);
    $result_item = execute_request_to_google($data_item, $gaurl);
    // Вернуть результат данных отправленных в аналитику
    return array('result_transaction' => $result_transaction, 'result_item' => $result_item, 'data_transaction' => $data_transaction, 'data_item' => $data_item);
}
开发者ID:kibal4iw,项目名称:google-measurement-protocol-curl-request,代码行数:31,代码来源:index.php


示例4: edit

 public function edit($arg = null)
 {
     $account = new stdClass();
     if ($arg != null) {
         $account = $this->Mdl_Accounts->get($arg);
         $account->isNew = false;
     } else {
         $account->isNew = true;
         $account->id = gen_uuid();
         $account->username = "";
         $account->firstname = "";
         $account->lastname = "";
         $account->status = 1;
         $account->role = "administrator";
     }
     $arrRoles = ["Free user", "Concreteprotector"];
     $account->rolesHTML = "<select name='role'>";
     foreach ($arrRoles as $role) {
         $selected = "";
         $selected = $role == $account->role ? " selected " : "";
         $Role = ucfirst($role);
         $account->rolesHTML .= "<option {$selected} value='{$role}'>{$Role}</option>";
     }
     $account->rolesHTML .= "</select>";
     parent::initView(get_class($this) . '/edit', 'Accounts', 'Edit account information.', $account);
     parent::loadView();
 }
开发者ID:WangYinXing,项目名称:ce-admin,代码行数:27,代码来源:TBView_Accounts.php


示例5: add_data_header

function add_data_header($link)
{
    $access_id = gen_uuid();
    $delete_code = gen_uuid();
    $sql = "INSERT INTO `impact`.`header_data` (`id`, `access_id`, `delete_code`, `created`) VALUES (NULL, '" . $access_id . "', '" . $delete_code . "', CURRENT_TIMESTAMP)";
    $result = $link->query($sql);
    return array("id" => mysqli_insert_id($link), "access_id" => $access_id, "delete_code" => $delete_code);
}
开发者ID:arctro,项目名称:Impact,代码行数:8,代码来源:index.php


示例6: edit

 public function edit($id = null)
 {
     $record = new stdClass();
     $ings = $this->Mdl_Systems->getIngredients();
     if ($id != null) {
         $record = $this->Mdl_Systems->get($id);
         $record->isNew = false;
     } else {
         $record->isNew = true;
         $record->id = gen_uuid();
         $record->name = "";
         $record->saleprice = "";
         $record->share = "f";
         $record->status = true;
     }
     $share = "";
     $active = "";
     if ($record->share == "t") {
         $share = "checked";
     }
     if ($record->status) {
         $active = "checked";
     }
     $record->shareHTML = "<input {$share} id='share' type='checkbox' name='_share'><label for='share'>&nbsp;&nbsp;Share</label>";
     $record->activeHTML = "<input {$active} id='status' type='checkbox' name='_status'><label for='status'>&nbsp;&nbsp;Active</label>";
     /*
     	Colors....
     */
     $record->ingredientsHTML = "";
     foreach ($ings as $ing) {
         $checked = "";
         $extra = "";
         $factor = "";
         if (!$record->isNew) {
             foreach ($record->selIngs as $selIng) {
                 if ($selIng->ingredientid == $ing->id) {
                     $checked = "checked";
                     $extra = $selIng->extra;
                     $factor = $selIng->factor;
                 }
             }
         }
         $record->ingredientsHTML .= "<div class='row ing'>";
         $record->ingredientsHTML .= "<div class='col-md-8'>";
         $record->ingredientsHTML .= "<input {$checked} id='{$ing->id}' type='checkbox' name='{$ing->id}' value='1'><label for='{$ing->id}'>&nbsp;&nbsp;{$ing->name}</label><br>";
         $record->ingredientsHTML .= "</div>";
         $record->ingredientsHTML .= "<div class='col-md-2'>";
         $record->ingredientsHTML .= "<div class='row item'><div class='col-md-4'><label >{$ing->purchaseprice}</label></div><div class='col-md-8'><input class='_extra' name='{$ing->id}' value='{$extra}'/></div>";
         $record->ingredientsHTML .= "</div></div>";
         $record->ingredientsHTML .= "<div class='col-md-2'>";
         $record->ingredientsHTML .= "<div class='row item'><div class='col-md-4'><label >Units extra</label></div><div class='col-md-8'><input class='_factor' name='{$ing->id}' value='{$factor}'/></div>";
         $record->ingredientsHTML .= "</div></div>";
         $record->ingredientsHTML .= "</div>";
     }
     parent::initView("Systems/edit", "Systems", 'Edit Systems information.', $record);
     parent::loadView();
 }
开发者ID:WangYinXing,项目名称:ce-admin,代码行数:57,代码来源:TBView_Systems.php


示例7: renderContent

 protected function renderContent()
 {
     if (isset($this->block) && $this->block != null) {
         $model = new UserAvatarForm();
         if (isset($_POST['UserAvatarForm'])) {
             $model->attributes = $_POST['UserAvatarForm'];
             $model->image = CUploadedFile::getInstance($model, 'image');
             if ($model->validate()) {
                 //Get the User Id to determine the folder
                 $folder = user()->id >= 1000 ? (string) (round(user()->id / 1000) * 1000) : '1000';
                 $filename = user()->id . '_' . gen_uuid();
                 if (!(file_exists(AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $folder) && AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $folder)) {
                     mkdir(AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $folder, 0777, true);
                 }
                 if (file_exists(AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $filename . '.' . strtolower(CFileHelper::getExtension($model->image->name)))) {
                     $filename .= '_' . time();
                 }
                 $filename = $filename . '.' . strtolower(CFileHelper::getExtension($model->image->name));
                 $path = $folder . DIRECTORY_SEPARATOR . $filename;
                 if ($model->image->saveAs(AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $path)) {
                     //Generate thumbs
                     //
                     GxcHelpers::generateAvatarThumb($filename, $folder, $filename);
                     //So we will start to check the info from the user
                     $current_user = User::model()->findByPk(user()->id);
                     if ($current_user) {
                         if ($current_user->avatar != null && $current_user->avatar != '') {
                             //We will delete the old avatar here
                             $old_avatar_path = $current_user->avatar;
                             $current_user->avatar = $path;
                             if (file_exists(AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $old_avatar_path)) {
                                 @unlink(AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $old_avatar_path);
                             }
                             //Delete old file Sizes
                             $sizes = AvatarSize::getSizes();
                             foreach ($sizes as $size) {
                                 if (file_exists(AVATAR_FOLDER . DIRECTORY_SEPARATOR . $size['id'] . DIRECTORY_SEPARATOR . $old_avatar_path)) {
                                     @unlink(AVATAR_FOLDER . DIRECTORY_SEPARATOR . $size['id'] . DIRECTORY_SEPARATOR . $old_avatar_path);
                                 }
                             }
                         } else {
                             //$current_user
                             $current_user->avatar = $path;
                         }
                         $current_user->save();
                     }
                 } else {
                     throw new CHttpException('503', 'Error while uploading!');
                 }
             }
         }
         $this->render(BlockRenderWidget::setRenderOutput($this), array('model' => $model));
     } else {
         echo '';
     }
 }
开发者ID:nganhtuan63,项目名称:gxc-app,代码行数:56,代码来源:AvatarBlock.php


示例8: alphaId

 public static function alphaId($len = 10)
 {
     $hex = md5("statme" . uniqid("", true));
     $pack = pack('H*', $hex);
     $tmp = base64_encode($pack);
     $uid = preg_replace("#(*UTF8)[^A-Za-z0-9]#", "", $tmp);
     $len = max(4, min(128, $len));
     while (strlen($uid) < $len) {
         $uid .= gen_uuid(22);
     }
     return substr($uid, 0, $len);
 }
开发者ID:nlegoff,项目名称:statme,代码行数:12,代码来源:Utils.php


示例9: edit

 public function edit($id = null)
 {
     $color = new stdClass();
     if ($id != null) {
         $color = $this->Mdl_Patterns->get($id);
         $color->isNew = false;
     } else {
         $color->isNew = true;
         $color->id = gen_uuid();
         $color->name = "";
     }
     parent::initView("Patterns/edit", "Patterns", 'Edit pattern information.', $color);
     parent::loadView();
 }
开发者ID:WangYinXing,项目名称:ce-admin,代码行数:14,代码来源:TBView_Patterns.php


示例10: store_result

 public function store_result($result_data)
 {
     $success = TRUE;
     // Generate unique id from application/helpers/uuid_helper.php
     $uuid = gen_uuid();
     $result_data['resid'] = $uuid;
     // Transaction
     $this->db->trans_start();
     if (!$this->db->insert('results', $result_data)) {
         $success = FALSE;
     }
     $this->db->trans_complete();
     return $success;
 }
开发者ID:ubriela,项目名称:middlebox-ws,代码行数:14,代码来源:result_model.php


示例11: edit

 public function edit($id = null)
 {
     $color = new stdClass();
     if ($id != null) {
         $color = $this->Mdl_Colors->get($id);
         $color->isNew = false;
     } else {
         $color->isNew = true;
         $color->id = gen_uuid();
         $color->name = "";
     }
     parent::initView(get_class($this) . '/edit', 'Colors', 'Edit color information.', $color);
     parent::loadView();
 }
开发者ID:WangYinXing,项目名称:ce-admin,代码行数:14,代码来源:TBView_Colors.php


示例12: edit

 public function edit($id = null)
 {
     $record = new stdClass();
     $colors = $this->Mdl_Ingredients->getColors();
     $patterns = $this->Mdl_Ingredients->getPatterns();
     if ($id != null) {
         $record = $this->Mdl_Ingredients->get($id);
         $record->isNew = false;
     } else {
         $record->isNew = true;
         $record->id = gen_uuid();
         $record->name = "";
         $record->coverage = "";
         $record->purchaseprice = "";
     }
     /*
     	Colors....
     */
     $record->colorsHTML = "";
     foreach ($colors as $col) {
         $checked = "";
         if (!$record->isNew) {
             foreach ($record->selectedColors as $selCol) {
                 if ($selCol->colorid == $col->id) {
                     $checked = "checked";
                 }
             }
         }
         $record->colorsHTML .= "<input {$checked} id='{$col->id}' type='checkbox' name='{$col->id}' value='1'><label for='{$col->id}'>&nbsp;&nbsp;{$col->name}</label><br>";
     }
     /*
     	Patterns....
     */
     $record->patternsHTML = "";
     foreach ($patterns as $pat) {
         $checked = "";
         if (!$record->isNew) {
             foreach ($record->selectedPatterns as $selPat) {
                 if ($selPat->patternid == $pat->id) {
                     $checked = "checked";
                 }
             }
         }
         $record->patternsHTML .= "<input {$checked} id='{$pat->id}' type='checkbox' name='{$pat->id}' value='1'><label for='{$pat->id}'>&nbsp;&nbsp;{$pat->name}</label><br>";
     }
     parent::initView("Ingredients/edit", "Ingredients", 'Edit ingredient information.', $record);
     parent::loadView();
 }
开发者ID:WangYinXing,项目名称:ce-admin,代码行数:48,代码来源:TBView_Ingredients.php


示例13: activate_addon

function activate_addon()
{
    $guid_option_name = "lfeguid";
    $base_url_option_name = "base_url";
    if (!get_option($guid_option_name)) {
        add_option($guid_option_name, gen_uuid());
    }
    $base_url = 'http://apps.lfe.com';
    if (get_option($base_url_option_name)) {
        update_option($base_url_option_name, $base_url);
    } else {
        add_option($base_url_option_name, $base_url);
    }
    //file_get_contents
    wp_remote_get($base_url . '/WidgetEndPoint/Plugin/Install?' . http_build_query(array('uid' => get_option($guid_option_name), 'domain' => get_site_url(), 'type' => 3, 'version' => get_bloginfo('version'), 'pluginVersion' => "1.0.0")));
}
开发者ID:Juni4567,项目名称:meritscholarship,代码行数:16,代码来源:lfe-widget.php


示例14: api_createSession

function api_createSession($uid)
{
    include "db_config.php";
    mysql_set_charset('UTF8');
    $date = date("Y-m-d H:i:s");
    //Date Actuel
    $UUID = gen_uuid();
    // génération UUID
    $conn = mysql_connect($DB_host, $DB_login, $DB_pass);
    $db = mysql_select_db($DB_select, $conn);
    if (!$conn) {
        die('Erreur de connexion: ' . mysql_error());
    }
    $SQL = "INSERT INTO session(UUID,dateSession,uid) VALUES ('{$UUID}', '{$date}',{$uid})";
    $reponse = mysql_query($SQL);
    return $UUID;
}
开发者ID:hpatrick512,项目名称:stage-demain-le-printemps,代码行数:17,代码来源:Authentification.php


示例15: BuildOCPSoap

 function BuildOCPSoap()
 {
     /*
     Select the right region for your CRM
     crmna:dynamics.com - North America
     crmemea:dynamics.com - Europe, the Middle East and Africa
     crmapac:dynamics.com - Asia Pacific
     */
     $region = 'crmapac:dynamics.com';
     $OCPRequest = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
   <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action>
   <a:MessageID>urn:uuid:%s</a:MessageID>
   <a:ReplyTo>
     <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
   </a:ReplyTo>
   <a:To s:mustUnderstand="1">%s</a:To>
   <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
     <u:Timestamp u:Id="_0">
    <u:Created>%sZ</u:Created>
    <u:Expires>%sZ</u:Expires>
     </u:Timestamp>
     <o:UsernameToken u:Id="uuid-cdb639e6-f9b0-4c01-b454-0fe244de73af-1">
    <o:Username>%s</o:Username>
    <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">%s</o:Password>
     </o:UsernameToken>
   </o:Security>
    </s:Header>
    <s:Body>
   <t:RequestSecurityToken xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">
     <wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
    <a:EndpointReference>
      <a:Address>' . $region . '</a:Address>
    </a:EndpointReference>
     </wsp:AppliesTo>
     <t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType>
   </t:RequestSecurityToken>
    </s:Body>
  </s:Envelope>';
     $OCPRequest = sprintf($OCPRequest, gen_uuid(), 'https://login.microsoftonline.com/RST2.srf', getCurrentTime(), getNextDayTime(), $this->username, $this->password);
     return $OCPRequest;
 }
开发者ID:kgatjens,项目名称:crm-php,代码行数:42,代码来源:authentication.php


示例16: gen_uuid

function gen_uuid($len = 8)
{
    $hex = md5("summerfields_1864" . uniqid("", true));
    $pack = pack('H*', $hex);
    $uid = base64_encode($pack);
    // max 22 chars
    $uid = preg_replace("#(*UTF8)[^A-Za-z0-9]#", "", $uid);
    // mixed case
    if ($len < 4) {
        $len = 4;
    }
    if ($len > 128) {
        $len = 128;
    }
    // prevent silliness, can remove
    while (strlen($uid) < $len) {
        $uid = $uid . gen_uuid(22);
    }
    // append until length achieved
    return substr($uid, 0, $len);
}
开发者ID:servandserv,项目名称:sf,代码行数:21,代码来源:create-base-unions-sql.php


示例17: generate

 public static function generate($len = 8)
 {
     $hex = md5("a5cc85f1-e89a-4cc6-86a6-5b58db9a774e" . uniqid("", true));
     $pack = pack('H*', $hex);
     $uid = base64_encode($pack);
     // max 22 chars
     $uid = preg_replace("#(*UTF8)[^A-Za-z0-9]#", "", $uid);
     // mixed case
     if ($len < 4) {
         $len = 4;
     }
     if ($len > 128) {
         $len = 128;
     }
     // prevent silliness, can remove
     while (strlen($uid) < $len) {
         $uid = $uid . gen_uuid(22);
     }
     // append until length achieved
     return substr($uid, 0, $len);
 }
开发者ID:servandserv,项目名称:sf,代码行数:21,代码来源:UUID.php


示例18: gen_uuid

function gen_uuid($len = 8)
{
    $hex = md5("your_random_salt_here_31415" . uniqid("", true));
    $pack = pack('H*', $hex);
    $uid = base64_encode($pack);
    // max 22 chars
    $uid = ereg_replace("[^A-Za-z0-9]", "", $uid);
    // mixed case
    //$uid = ereg_replace("[^A-Z0-9]", "", strtoupper($uid));    // uppercase only
    if ($len < 4) {
        $len = 4;
    }
    if ($len > 128) {
        $len = 128;
    }
    // prevent silliness, can remove
    while (strlen($uid) < $len) {
        $uid = $uid . gen_uuid(22);
    }
    // append until length achieved
    return substr($uid, 0, $len);
}
开发者ID:RalphSleigh,项目名称:scorecard,代码行数:22,代码来源:get_session.php


示例19: save

 function save($id, $record)
 {
     // Update ....
     if (!$record['isNew']) {
         $this->db->update('system', ["name" => $record['name'], "saleprice" => $record['saleprice'], "status" => $record['status'], "share" => $record['share']], "id = '{$id}'");
         // Colors
         // Remove all colors first.
         $this->db->delete('systemdetail', ['systemid' => $id]);
     } else {
         $this->db->insert('system', buildBaseParam(["id" => $id = gen_uuid(), "name" => $record['name'], "saleprice" => $record['saleprice'], "status" => $record['status'], "share" => $record['share']], $this->session->userdata('id')));
     }
     $selIngs = json_decode($record['selIngs']);
     $arrSelectedIngs = [];
     foreach ($selIngs as $key => $val) {
         if ($val->checked) {
             array_push($arrSelectedIngs, buildBaseParam(['systemid' => $id, 'ingredientid' => $key, 'extra' => $val->extra, 'factor' => $val->factor, 'id' => gen_uuid(), 'status' => 1], $this->session->userdata('id')));
         }
     }
     // Re-add all colors.
     if (count($arrSelectedIngs)) {
         $this->db->insert_batch('systemdetail', $arrSelectedIngs);
     }
 }
开发者ID:WangYinXing,项目名称:ce-admin,代码行数:23,代码来源:Mdl_Leads.php


示例20: save

 function save($id, $ingredient)
 {
     // Update ....
     if (!$ingredient['isNew']) {
         $this->db->update('ingredient', ["name" => $ingredient['name'], "coverage" => $ingredient['coverage'], "purchaseprice" => $ingredient['purchaseprice']], "id = '{$id}'");
     } else {
         $this->db->insert('ingredient', buildBaseParam(["id" => $id = gen_uuid(), "name" => $ingredient['name'], "coverage" => $ingredient['coverage'], "purchaseprice" => $ingredient['purchaseprice']], $this->session->userdata('id')));
     }
     // Colors
     // Remove all colors first.
     $this->db->delete('ingredientcolor', ['ingredientid' => $id]);
     $selColors = json_decode($ingredient['selCols']);
     $arrSelectedColors = [];
     foreach ($selColors as $key => $val) {
         if ($val == 1) {
             array_push($arrSelectedColors, buildBaseParam(['colorid' => $key, 'ingredientid' => $id, 'id' => gen_uuid()], $this->session->userdata('id')));
         }
     }
     // Re-add all colors.
     if (count($arrSelectedColors)) {
         $this->db->insert_batch('ingredientcolor', $arrSelectedColors);
     }
     // Patterns
     // Remove all patterns first.
     $this->db->delete('ingredientpattern', ['ingredientid' => $id]);
     $selPatterns = json_decode($ingredient['selPats']);
     $arrSelectedPatterns = [];
     foreach ($selPatterns as $key => $val) {
         if ($val == 1) {
             array_push($arrSelectedPatterns, buildBaseParam(['patternid' => $key, 'ingredientid' => $id, 'id' => gen_uuid()], $this->session->userdata('id')));
         }
     }
     // Re-add all colors.
     if (count($arrSelectedPatterns)) {
         $this->db->insert_batch('ingredientpattern', $arrSelectedPatterns);
     }
 }
开发者ID:WangYinXing,项目名称:ce-admin,代码行数:37,代码来源:Mdl_Ingredients.php



注:本文中的gen_uuid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP generarDSNSistema函数代码示例发布时间:2022-05-24
下一篇:
PHP gb2utf8函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap