Beispiel #1
0
 public static function insert_user_driveinfo($data = array())
 {
     //查詢會員是否有來過活動網站
     $query = "SELECT * FROM `tk_buburegusr` WHERE `usr_uid` = '" . $data['user_id'] . "'";
     $user = dbconn::db_getRow($query);
     //產生介紹碼
     $makekey = dbconn::make_newkey();
     //判斷是否有相同的裝置ID
     $query = "SELECT * FROM `tk_bubu_deviceids` WHERE `dev_deviceid` = '" . $data['device_id'] . "'";
     $drivedata = dbconn::db_getRow($query);
     #show_Debug( $data );
     #show_Debug( $query );
     #show_Debug( $drivedata );
     #exit();
     if (empty($drivedata)) {
         if (empty($user)) {
             //沒來過,灌入新的資料
             $sql = "INSERT INTO `tk_buburegusr`(\n\t\t\t\t\t\t`usr_uid`, `usr_new`, `usr_makekey`, `usr_comkey`, `usr_appstatus` , `created_at`, `updated_at`\n\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t'" . $data['user_id'] . "','0','" . $makekey . "','','1','" . date('Y-m-d H:i:s') . "','" . date('Y-m-d H:i:s') . "'\n\t\t\t\t\t)";
             $result = dbconn::db_query($sql);
             $sql2 = "INSERT INTO `tk_bubu_deviceids`( `dev_uid`, `dev_deviceid`, `created_at`, `updated_at`) VALUES ('" . $data['user_id'] . "','" . $data['device_id'] . "','" . date('Y-m-d H:i:s') . "','" . date('Y-m-d H:i:s') . "')";
             $result = dbconn::db_query($sql2);
         } else {
             //有來過,更新資料
             $sql = "UPDATE `tk_buburegusr` SET `usr_appstatus`='1',`updated_at`='" . date('Y-m-d H:i:s') . "' WHERE `usr_uid` = '" . $data['user_id'] . "'";
             $result = dbconn::db_query($sql);
             $sql2 = "INSERT INTO `tk_bubu_deviceids`( `dev_uid`, `dev_deviceid`, `created_at`, `updated_at`) VALUES ('" . $data['user_id'] . "','" . $data['device_id'] . "','" . date('Y-m-d H:i:s') . "','" . date('Y-m-d H:i:s') . "')";
             $result = dbconn::db_query($sql2);
         }
         return 1;
     } else {
         return 0;
     }
 }
Beispiel #2
0
 public static function query_email_send_status($ticket = '')
 {
     $query = "SELECT * FROM `tk_tripticket` WHERE `mem_tripticket` = '" . $ticket . "'";
     $result = dbconn::db_getRow($query);
     return $result;
 }