コード例 #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
ファイル: consumedetail.php プロジェクト: BlackCodes/Mymine
<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>Consume Detail</span></h2></div>
        <div class="product-title"><?php 
echo $store['storeName'];
?>
  <h7><?php 
echo $store['createTime'];
?>
</h7></div>
        <div class="row">
            <div class="col-md-4"><img src="<?php 
echo EasyHelpers::getStoreLogoUrl($store['logo']);
?>
" class="product-img" />  </div>
            <div class="col-md-5 attribute"> 
                <div class="row row-line">
                    <div class="col-md-3">状态:</div>
                    <div class="col-md-8"><?php 
$status = '';
switch ($store['status']) {
    case 'waiting':
        $status = '待审核';
        break;
    case 'approval':
        $status = '审核通过';
        break;
    case 'deny':
コード例 #3
0
ファイル: StoreController.php プロジェクト: BlackCodes/Mymine
 /**
  * 根据手机号获取店铺信息
  * @return type
  */
 public function actionGetstoreinfo()
 {
     $request = \Yii::$app->request;
     $userMobile = $request->_get('userMobile', 0);
     $userId = $request->_get('userId', 0);
     $usign = $request->_get('usign', '');
     if ($usign != EasyHelpers::encrypty($userId, \Yii::$app->params['key'])) {
         return ['code' => 5, 'msg' => '非法数据'];
     }
     if (!$userMobile) {
         return ['code' => 1, 'msg' => '非法数据'];
     }
     if (!EasyHelpers::checkMobile($userMobile)) {
         return ['code' => 1, 'msg' => '手机号格式不正确'];
     }
     $user = User::findByMobile($userMobile);
     if (!$user) {
         return ['code' => 1, 'msg' => '用户不存在'];
     } else {
         if ($user->userId == $userId) {
             return ['code' => 1, 'msg' => '不能给自己发送'];
         }
         $store = Store::getStoreInfo($user->userId);
         if (!$store) {
             return ['code' => 1, 'msg' => '用户没有店铺'];
         }
         if ($store['status'] != 'approval') {
             return ['code' => 1, 'msg' => '用户店铺没有通过审核'];
         }
     }
     $data['userId'] = $store['userId'];
     $data['storeName'] = $store['storeName'];
     $data['logo'] = EasyHelpers::getStoreLogoUrl($store['logo']);
     return ['code' => 0, 'msg' => '操作成功', 'data' => $data];
 }