Exemplo n.º 1
0
 public function view_addPlatformList()
 {
     $platform = isset($_POST['platform']) ? post_check($_POST['platform']) : '';
     $status = '';
     if (empty($platform)) {
         $status = '平台名称为空,添加失败';
         header("location:index.php?mod=omPlatform&act=getOmPlatformList&status={$status}");
         exit;
     }
     $omAvailableAct = new OmAvailableAct();
     $tName = 'om_platform';
     $where = "WHERE is_delete=0 and platform='{$platform}'";
     $count = $omAvailableAct->act_getTNameCount($tName, $where);
     if ($count) {
         $status = '平台名称已存在,添加失败';
         header("location:index.php?mod=omPlatform&act=getOmPlatformList&status={$status}");
         exit;
     }
     $addUser = $_SESSION['sysUserId'];
     $addTime = time();
     $set = "SET platform='{$platform}',addUser='******',addTime='{$addTime}'";
     $affectRow = $omAvailableAct->act_addTNameRow($tName, $set);
     if ($affectRow) {
         //更新老系统
         $returnInfo = OldsystemModel::erpSyncPlatform($platform, 'insert');
         if ($returnInfo['res_code'] == 200) {
             $status = '添加成功';
         } else {
             $status = '更新老系统失败';
         }
     } else {
         $status = '添加失败';
     }
     header("location:index.php?mod=omPlatform&act=getOmPlatformList&status={$status}");
 }
Exemplo n.º 2
0
 public function view_addAccountList()
 {
     $account = isset($_POST['account']) ? post_check($_POST['account']) : '';
     $platformId = isset($_POST['platformId']) ? post_check($_POST['platformId']) : '';
     $appname = isset($_POST['appname']) ? post_check($_POST['appname']) : '';
     $email = isset($_POST['email']) ? post_check($_POST['email']) : '';
     $suffix = isset($_POST['suffix']) ? post_check($_POST['suffix']) : '';
     $charger = isset($_POST['charger']) ? post_check($_POST['charger']) : '';
     $status = '';
     if (empty($account) || intval($platformId) == 0 || empty($appname) || empty($email) || empty($suffix)) {
         $status = '<font color="red">数据异常,添加失败</font>';
         header("location:index.php?mod=omAccount&act=getAccountList&status={$status}");
         exit;
     }
     $omAvailableAct = new OmAvailableAct();
     $tName = 'om_account';
     $where = "WHERE is_delete=0 and account='{$account}' ";
     $count = $omAvailableAct->act_getTNameCount($tName, $where);
     if ($count) {
         $status = '<font color="red">账号名称已存在,添加失败</font>';
         header("location:index.php?mod=omAccount&act=getAccountList&status={$status}");
         exit;
     }
     $addUser = $_SESSION['sysUserId'];
     $addTime = time();
     $set = "SET account='{$account}',platformId='{$platformId}',appname='{$appname}',email='{$email}',suffix='{$suffix}',charger='{$charger}',addUser='******',addTime='{$addTime}'";
     $affectRow = $omAvailableAct->act_addTNameRow($tName, $set);
     if ($affectRow) {
         $status = '<font color="green">添加成功</font>';
     } else {
         $status = '<font color="red">添加失败</font>';
     }
     header("location:index.php?mod=omAccount&act=getAccountList&status={$status}");
 }
Exemplo n.º 3
0
    $partner['QQ'] = $result['QQ'];
    $partner['AliIM'] = $result['AliIM'];
    $partner['shoplink'] = $result['shop_link'];
    $partner['e_mail'] = $result['mail'];
    $partner['address'] = $result['address'];
    $partner['note'] = $result['note'];
    $partner['city'] = $result['city'];
    $partner['sms_status'] = $result['is_sms'];
    $partner['email_status'] = $result['is_email'];
    $purchaser = isset($result['purchaseuser']) ? trim($result['purchaseuser']) : '';
    $purchaserId = getPurchaserId($purchaser);
    $partner['purchaseuser_id'] = $purchaserId;
    $partner['company_id'] = 1;
    $set = array2sql($partner);
    $set = ' SET ' . $set;
    $ret = $omAvailableAct->act_addTNameRow('ph_partner', $set);
    //echo "===key=$key-----purchaseId=$purchaserId\n";
}
echo 'SUCCESS!';
exit;
function getPurchaserId($purchaser)
{
    if ($purchaser == '') {
        return '';
    }
    global $omAvailableAct;
    $where = " WHERE global_user_name = '{$purchaser}' ";
    $result = $omAvailableAct->act_getTNameList('power_global_user', 'global_user_id', $where);
    //print_r($result);
    return $result[0]['global_user_id'];
}