コード例 #1
0
 /**
  * 获取产品信息
  */
 public function actionIndex()
 {
     //3SCJEJSEZB
     $prdouctId = \Yii::$app->request->get('code', 0);
     if (!intval($prdouctId)) {
         return ['code' => 4, 'msg' => 'undefine parameter', 'data' => []];
     }
     $prdouctId = EasyHelpers::pidDecrypt($prdouctId);
     $product = Product::getProductById($prdouctId);
     if (!$product) {
         return ['code' => 3, 'msg' => 'data is not exist', 'data' => []];
     }
     $mcoin = MiaoCoin::getMiaoCoin($product['ownid']);
     //       if($mcoin<1) return ['code'=>4,'msg'=>'balance is insufficient','data'=>[]];
     //       if($product['status']!='online') return ['code'=>5,'msg'=>'This product had down shelf','data'=>[]];
     $store = Store::getStoreInfo($product['ownid']);
     $res = ['seller' => $store->storeName, 'storePhone' => $store->tel, 'storeMobile' => $store->mobile, 'storeAddress' => $store->address, 'storeLogo' => EasyHelpers::getStoreLogoUrl($store->logo)];
     $exclude = ['sku', 'hiddenBrand', 'ownid', 'from', 'createTime', 'updateTime', 'qrImage', 'originName'];
     foreach ($product as $key => $value) {
         if (!$value || in_array($key, $exclude)) {
             continue;
         }
         if ($key == "size") {
             $tempSize = [];
             $tempSize = explode('*', $value);
             $res['productLength'] = $tempSize[0];
             $res['productWidth'] = $tempSize[1];
             $res['productHeight'] = $tempSize[2];
             continue;
         }
         if ($key == 'productId') {
             $res['productId'] = EasyHelpers::pidEncrypt($value);
             continue;
         }
         if ($key == 'newName') {
             $res['productImageName'] = $value;
             continue;
         }
         if ('status' == $key) {
             $res['hasComplete'] = 'offline' == $value || 'online' == $value ? true : false;
             continue;
         }
         if ('material' == $key) {
             $res['productMaterial'] = $value;
             continue;
         }
         $res[$key] = $value;
     }
     if ($product['type'] == 'virtual') {
         $res['productDescript'] = $product['re_product']['productDescript'];
         $res['productImage'] = \Yii::$app->sysConfig->getConfig()->default['imageDomain'] . 'product/thumb/' . $product['re_product']['newName'];
         $productFlie = Product::getFileName($product['re_product']['productId']);
     } else {
         $res['productImage'] = \Yii::$app->sysConfig->getConfig()->default['imageDomain'] . 'product/thumb/' . $product['newName'];
         $productFlie = Product::getFileName($prdouctId);
     }
     $res['favorite'] = Favorite::getCount($prdouctId);
     $res['hasView'] = $productFlie ? true : false;
     return ['code' => 0, 'msg' => 'success', 'data' => $res];
 }
コード例 #2
0
ファイル: index.php プロジェクト: BlackCodes/Mymine
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;
use common\helpers\EasyHelpers;
$userId = \Yii::$app->user->id;
$usercode = EasyHelpers::pidEncrypt($userId);
$url = \Yii::$app->sysConfig->getConfig()->default['apiDomain'];
$imageDomain = \Yii::$app->sysConfig->getConfig()->default['imageDomain'];
?>

<style type="text/css">
    .body_withdrawrecord_index{
        padding-top: 13px;
    }
    .body_withdrawrecord_index .portlet.box .portlet-body{
        position: relative;
        padding-bottom: 40px;
    }
    .error{
        color:red;
    }
</style>

<div class="body_withdrawrecord_index">
    <div class="container-fluid">
        <div class="apply_tit_div"><h2><img src="<?php 
echo url::to('@web/image/tx_tit_icon.png', true);
?>
">产品管理<span>withdraw center</span></h2></div>
コード例 #3
0
ファイル: main.php プロジェクト: BlackCodes/Mymine
					if($('.newpwd').val()!=$('.repeat-pwd').val()){
						$.alert({
							'title':false,
							'content':'两次密码不一致'
						});
						return false;
					}
					data= {token:"<?php 
echo $token;
?>
",
						   pwd:$('.oldpwd').val(),
						   newpwd:$(".newpwd").val(),
						   repwd:$('.repeat-pwd').val(),
						   usercode:"<?php 
echo EasyHelpers::pidEncrypt(\Yii::$app->user->id);
?>
"}
					$.ajax({
                        url: "<?php 
echo \yii::$app->sysConfig->getConfig()->default['apiDomain'] . 'backend/adminmanage/modifypwd';
?>
",
                        type: 'get',
                        dataType: 'jsonp',
                        jsonp: 'jsonpCallback',
                        data: data,
                        success: function (response) {
                            if (response.code !== 0) {
                                $.alert({content: response.message});
                                return;