Example #1
0
 /**
  * 处理扫码内容
  * @param type $object
  * @param User $weixinuser
  */
 public static function fitScancode_waitmsg($object, User $weixinuser)
 {
     $scanType = $object->ScanCodeInfo->ScanType;
     $content = " 扫描结果:" . $object->ScanCodeInfo->ScanResult;
     if ($scanType == 'qrcode') {
         $string = $object->ScanCodeInfo->ScanResult;
         #解码
         #获得ID
         $data = explode(",", $string);
         if (is_numeric($data[0]) && isset($data[1]) && is_numeric($data[1]) && isset($data[2]) && !empty($data[2])) {
             #获得货物数据
             $acType = intval($data[0]);
             switch ($acType) {
                 case 0:
                     $content = LogisticsService::fitOutCode($weixinuser, $data);
                     break;
                 case 1:
                     $content = LogisticsService::fitGetCode($weixinuser, $data);
                     break;
                 default:
                     $content = '该信息不存在或者已经被接单。';
             }
         }
     }
     WechatCheck::_transmitText($object, $content);
 }
Example #2
0
 /**
  * 默认为我的物品列表
  * @return type
  */
 public function actionIndex()
 {
     $params_get = \Yii::$app->request->get();
     if (isset($params_get['ac']) && isset($params_get['id'])) {
         LogisticsService::fitIndexAC($params_get);
     } else {
         return $this->render('logistics_index');
     }
 }
Example #3
0
 /**
  * 购买商品处理
  */
 public function actionVouch()
 {
     $this->view->title = "担保物品";
     $error = "";
     $backUrl = \Yii::$app->request->referrer;
     $p_param = Yii::$app->request->get();
     if (isset($p_param['id'])) {
         $pid = $p_param['id'];
         $logis = Logistics::find()->where("id=:id AND bail_lock=0 ", [':id' => $pid])->one();
         if ($logis) {
             #获得用户的可用资金
             $user_id = \Yii::$app->user->getId();
             if ($user_id == $logis->publis_user_id) {
                 $error = "不允许签约自己的物品。";
                 $notices = array('type' => 2, 'msgtitle' => '错误信息', 'message' => $error, 'backurl' => $backUrl, 'backtitle' => '返回');
             } else {
                 $userAccount = Account::find()->where("user_id=:user_id", [":user_id" => $user_id])->one();
                 echo $userAccount->use_money;
                 if ($userAccount->use_money > $logis->logis_bail) {
                     $result = LogisticsService::lockLogisticsBail($user_id, $logis->id);
                     if ($result['status'] == 1) {
                         $error = '签约成功!';
                         $notices = array('type' => 3, 'msgtitle' => '操作成功', 'message' => $error, 'backurl' => $backUrl, 'backtitle' => '返回', 'tourl' => Url::toRoute('/member/logistics/booked'), 'totitle' => '查看签约');
                     } else {
                         $error = $result['remark'];
                         $notices = array('type' => 2, 'msgtitle' => '错误信息', 'message' => $error, 'backurl' => $backUrl, 'backtitle' => '返回');
                     }
                 } else {
                     #跳转到充值页面
                     $error = "你的可用资金不足以购买此商品。";
                     $notices = array('type' => 3, 'msgtitle' => '错误信息', 'message' => $error, 'backurl' => $backUrl, 'backtitle' => '返回', 'tourl' => Url::toRoute('/member/account/chongzhi'), 'totitle' => '前往充值');
                 }
             }
         } else {
             $error = "该物品已经被签约。";
             $notices = array('type' => 2, 'msgtitle' => '错误信息', 'message' => $error, 'backurl' => $backUrl, 'backtitle' => '返回');
         }
     } else {
         $error = "不存在此物品。";
         $notices = array('type' => 2, 'msgtitle' => '错误信息', 'message' => $error, 'backurl' => $backUrl, 'backtitle' => '返回');
     }
     #msg类型:type=1错误信息2指示跳转3返回跳转
     Yii::$app->getSession()->setFlash('wechat_fail', array($notices));
     $this->redirect(Url::toRoute('/public/notices'));
 }
Example #4
0
use yii\helpers\Url;
use yii\helpers\Html;
$user_id = Yii::$app->user->getId();
$get = Yii::$app->request->get();
$showtype = 1;
if (isset($get['type'])) {
    $showtype = intval($get['type']);
}
?>
<div class="container no-bottom">
    <img class="responsive-image" src="/images/lanmu/bannar_logis.jpg" alt="img">
</div>
<?php 
echo $this->render('@app/modules/member/views/logistics/mem_logis_Menu.php');
$data = ['user_id' => $user_id, 'limit' => 10];
$logisLists = LogisticsService::findMyGifts($data);
?>
<div class="one-half-responsive last-column padding15px">
    <?php 
if ($logisLists['models']) {
    ?>
        <?php 
    Pjax::begin(['id' => 'loadpajax']);
    $begin = $logisLists['pages']->getPage() * $logisLists['pages']->pageSize + 1;
    $end = $begin + $logisLists['pages']->getPageSize() - 1;
    if ($begin > $end) {
        $begin = $end;
    }
    ?>
        <div class="summary">第<b><?php 
    echo $begin . '-' . $end;
Example #5
0
use yii\helpers\Url;
use yii\helpers\Html;
$user_id = Yii::$app->user->getId();
$get = Yii::$app->request->get();
$showtype = 1;
if (isset($get['type'])) {
    $showtype = intval($get['type']);
}
?>
<div class="container no-bottom">
    <img class="responsive-image" src="/images/lanmu/bannar_logis.jpg" alt="img">
</div>
<?php 
echo $this->render('@app/modules/member/views/logistics/mem_logis_Menu.php');
$data = ['user_id' => $user_id, 'limit' => 10];
$logisLists = LogisticsService::findMyLogiss($data);
?>
<div class="one-half-responsive last-column padding15px">
    <?php 
if ($logisLists['models']) {
    ?>
        <?php 
    Pjax::begin(['id' => 'loadpajax']);
    $begin = $logisLists['pages']->getPage() * $logisLists['pages']->pageSize + 1;
    $end = $begin + $logisLists['pages']->getPageSize() - 1;
    if ($begin > $end) {
        $begin = $end;
    }
    ?>
        <div class="summary">第<b><?php 
    echo $begin . '-' . $end;
Example #6
0
 /**
  * 保存商品
  */
 public function save()
 {
     $newLogis = new Logistics();
     $newLogis->setAttributes($this->attributes);
     $newLogis->setAttribute('user_country', $this->user_country);
     $newLogis->setAttribute('user_province', $this->user_province);
     $newLogis->setAttribute('user_city', $this->user_city);
     $newLogis->setAttribute('user_area', $this->user_area);
     $newLogis->setAttribute('user_address', $this->user_address);
     $newLogis->setAttribute('fit_user_id', 0);
     $newLogis->setAttribute('bail_lock', 0);
     $newLogis->setAttribute('fee_lock', 0);
     $newLogis->setAttribute('logis_arrivetime', strtotime($this->logis_arrivetime));
     $newLogis->setAttribute('logis_realarrivetime', 0);
     $newLogis->setAttribute("logis_addtime", time());
     $newLogis->setAttribute('logis_addip', \Yii::$app->request->userIp);
     if ($newLogis->save()) {
         $logisct_id = \Yii::$app->db->lastInsertID;
         $result = LogisticsService::lockLogisticsFee($this->publis_user_id, $logisct_id);
         if ($result['status'] == 1) {
             return $logisct_id;
         } else {
             $this->addError('logis_name', $result['remark']);
             return FALSE;
         }
     } else {
         return FALSE;
     }
 }
Example #7
0
<?php

/* @var $this yii\web\View */
$this->title = '物流列表';
use frontend\services\LogisticsService;
use yii\helpers\Url;
use frontend\extensions\scrollpager\ScrollPager;
use yii\widgets\ListView;
echo $this->render('@app/views/layouts/main_header.php', ['icons' => ['product-content' => Url::toRoute('/logistics/publishlogistics'), 'twitter-content' => Url::toRoute('/index')]]);
echo $this->render('@app/views/layouts/servicesMenu.php');
?>
<div class="content">
    <?php 
$data = ['limit' => 5, 'fee_lock' => 1];
$logisticsLists = LogisticsService::findLogisticss($data);
if ($logisticsLists) {
    echo ListView::widget(['dataProvider' => $logisticsLists, 'itemOptions' => ['class' => 'item qys-item'], 'itemView' => '_item_logistics_view', 'pager' => ['class' => ScrollPager::className()]]);
} else {
    ?>

        <div class="container" style="min-height: 350px;">
            <p>还没有发布商品</p>
        </div>
    <?php 
}
?>
    <?php 
echo $this->render('@app/views/layouts/main_footer.php');
?>
</div>
Example #8
0
use yii\helpers\Url;
use yii\helpers\Html;
$user_id = Yii::$app->user->getId();
$get = Yii::$app->request->get();
$showtype = 1;
if (isset($get['type'])) {
    $showtype = intval($get['type']);
}
?>
<div class="container no-bottom">
    <img class="responsive-image" src="/images/lanmu/bannar_logis.jpg" alt="img">
</div>
<?php 
echo $this->render('@app/modules/member/views/logistics/mem_logis_Menu.php');
$data = ['user_id' => $user_id, 'limit' => 10];
$logisLists = LogisticsService::findMyBooks($data);
?>
<div class="one-half-responsive last-column padding15px">
    <?php 
if ($logisLists['models']) {
    ?>
        <?php 
    Pjax::begin(['id' => 'loadpajax']);
    $begin = $logisLists['pages']->getPage() * $logisLists['pages']->pageSize + 1;
    $end = $begin + $logisLists['pages']->getPageSize() - 1;
    if ($begin > $end) {
        $begin = $end;
    }
    ?>
        <div class="summary">第<b><?php 
    echo $begin . '-' . $end;