public function actionIndex()
 {
     U::W([__METHOD__, $_GET, $_POST]);
     //$this->layout = false;
     $this->layout = 'wapy';
     $alipay_config = Alipay::getAlipayConfig();
     $alipayNotify = new AlipayNotify($alipay_config);
     $verify_result = $alipayNotify->verifyReturn();
     if (!$verify_result) {
         Alipay::logResult(['Alipaycallback error', __METHOD__, $_GET, $_POST]);
         //return 'Alipaycallback error';
     }
     $result = $_GET['result'];
     if ($result != 'success') {
         Alipay::logResult(['Pay error', __METHOD__, $_GET, $_POST]);
         return 'Pay error';
     }
     $oid = $_GET['out_trade_no'];
     $model = MOrder::findOne($oid);
     if ($model === null) {
         U::W(['Invalid oid', $_GET, $_POST]);
         return "Invalid oid";
     }
     $model->pay_kind = MOrder::PAY_KIND_ALIWAP;
     $model->aliwap_trade_no = $_GET['trade_no'];
     $model->status = MOrder::STATUS_SUCCEEDED;
     if (!$model->save(false)) {
         U::W(['save db error', $_GET, $_POST, $model->getErrors()]);
         return 'system error';
     }
     //return 'Pay OK';
     return $this->render('index', ['gh_id' => $model->gh_id, 'openid' => $model->openid]);
 }
Example #2
0
 public function search($params)
 {
     $query = MOrder::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['oid' => SORT_DESC]], 'pagination' => ['pageSize' => 20]]);
     $this->gh_id = Yii::$app->user->getGhid();
     //        $this->gh_id = \app\models\MGh::GH_XIANGYANGUNICOM;
     $this->addCondition($query, 'gh_id');
     if (!Yii::$app->user->getIsAdmin()) {
         $this->office_id = Yii::$app->user->identity->office_id;
         $this->addCondition($query, 'office_id');
     }
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $this->addCondition($query, 'office_id');
     $this->addCondition($query, 'oid', true);
     $this->addCondition($query, 'status');
     $this->addCondition($query, 'detail', true);
     $this->addCondition($query, 'feesum');
     $this->addCondition($query, 'cid');
     $this->addCondition($query, 'pay_kind');
     $this->addCondition($query, 'memo', true);
     //$this->addCondition($query, 'wldh');
     if (trim($this->create_time) !== '') {
         //$query->andWhere(['create_time' => new \yii\db\Expression(date('create_time')) ]);
         $query->andWhere('date(create_time)>=:create_time', [':create_time' => $this->create_time]);
     }
     if (trim($this->create_time_2) !== '') {
         //$query->andWhere(['create_time' => new \yii\db\Expression(date('create_time')) ]);
         $query->andWhere('date(create_time)<=:create_time_2', [':create_time_2' => $this->create_time_2]);
     }
     return $dataProvider;
 }
Example #3
0
 public function actionIndex()
 {
     U::W([__METHOD__, $_GET, $_POST]);
     $this->layout = false;
     $alipay_config = Alipay::getAlipayConfig();
     $alipayNotify = new AlipayNotify($alipay_config);
     $verify_result = $alipayNotify->verifyNotify();
     if (!$verify_result) {
         Alipay::logResult(['Alipaynotify sign error', __METHOD__, $_GET, $_POST]);
         return "fail";
     }
     if ($alipay_config['sign_type'] == 'MD5') {
         $respObject = @simplexml_load_string($_POST['notify_data']);
     } else {
         if ($alipay_config['sign_type'] == '0001') {
             $respObject = @simplexml_load_string($alipayNotify->decrypt($_POST['notify_data']));
         } else {
             Alipay::logResult(['Alipaynotify sign_type error', __METHOD__, $_GET, $_POST]);
         }
     }
     $arr = json_decode(json_encode($respObject), true);
     U::W($arr);
     $oid = $arr['out_trade_no'];
     $model = MOrder::findOne($oid);
     if ($model === null) {
         U::W(['Invalid oid', $_GET, $_POST, $arr]);
         return "success";
     }
     $model->pay_kind = MOrder::PAY_KIND_ALIWAP;
     $model->aliwap_trade_no = $arr['trade_no'];
     $model->aliwap_total_fee = $arr['total_fee'];
     $model->aliwap_trade_status = $arr['trade_status'];
     $model->aliwap_buyer_email = $arr['buyer_email'];
     $model->aliwap_quantity = $arr['quantity'];
     $model->aliwap_gmt_payment = $arr['gmt_payment'];
     if ($arr['trade_status'] == 'TRADE_FINISHED' || $arr['trade_status'] == 'TRADE_SUCCESS') {
         $model->status = MOrder::STATUS_SUCCEEDED;
     } else {
         U::W(['trade_status is not TRADE_FINISHED', $_GET, $_POST, $arr]);
     }
     if (!$model->save(false)) {
         U::W(['save db error', $_GET, $_POST, $arr, $model->getErrors()]);
     }
     return "success";
 }
Example #4
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($userid)
 {
     //$query = MOrder::find();
     $user = User::findOne(["id" => $userid]);
     if ($user->role == 1) {
         $query = MOrder::find()->orderBy(['create_time' => SORT_DESC]);
     } else {
         $query = MOrder::find()->where(["userid" => $user->id])->orderBy(['create_time' => SORT_DESC]);
     }
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['order_id' => $this->order_id, 'feesum' => $this->feesum, 'create_time' => $this->create_time, 'status' => $this->status, 'goods_id' => $this->goods_id, 'userid' => $this->userid]);
     $query->andFilterWhere(['like', 'oid', $this->oid])->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'usermobile', $this->usermobile])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'memo', $this->memo])->andFilterWhere(['like', 'memo_reply', $this->memo_reply]);
     return $dataProvider;
 }
Example #5
0
 public function search($params)
 {
     $query = \app\models\MOrder::find();
     $dataProvider = new \yii\data\ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['create_time' => SORT_DESC]], 'pagination' => false]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $this->addCondition($query, 'office_id');
     $this->addCondition($query, 'oid', true);
     $this->addCondition($query, 'status');
     $this->addCondition($query, 'detail', true);
     $this->addCondition($query, 'feesum');
     $this->addCondition($query, 'cid');
     $this->addCondition($query, 'pay_kind');
     $this->addCondition($query, 'memo', true);
     if (trim($this->create_time) !== '') {
         $query->andWhere('date(create_time)>=:create_time', [':create_time' => $this->create_time]);
     }
     if (trim($this->create_time_2) !== '') {
         $query->andWhere('date(create_time)<=:create_time_2', [':create_time_2' => $this->create_time_2]);
     }
     return $dataProvider;
 }
Example #6
0
</span></a></li>
       

        <?php 
if (!empty($user->staff) && $user->staff->cat == \app\models\MStaff::SCENE_CAT_IN) {
    $staff = $user->staff;
} else {
    $staff = $user->mobileStaff;
}
if (!empty($staff) && !empty($staff->office) && $staff->office->is_selfOperated) {
    ?>
        <li><a ajax-data="false" href="<?php 
    echo Url::to(['officeorder', 'gh_id' => $user->gh_id, 'openid' => $user->openid, 'staff_id' => $staff->staff_id]);
    ?>
" data-ajax="false"><img src="../web/images/woke/wddd.gif" alt="营业厅订单" class="ui-li-icon ui-corner-none">营业厅订单<span class="ui-li-count"><?php 
    echo MOrder::getOfficeOrdersCount($staff->office->office_id);
    ?>
</span></a></li>


        <?php 
}
?>


		<?php 
if (empty($user->user_account_charge_mobile)) {
    ?>
		<li><a href="#czsjmh"><img src="../web/images/woke/wdcf.gif" class="ui-li-icon ui-corner-none">充值手机号<span class="ui-li-count">未填</span></a></li>
		<?php 
} else {
Example #7
0
                            </div>
                            <div class="desc">
                                     成交金额
                            </div>
                    </div>
            </a>
    </div>
    <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
            <a class="dashboard-stat dashboard-stat-light purple-soft" href="javascript:;">
                    <div class="visual">
                            <i class="fa fa-shopping-cart"></i>
                    </div>
                    <div class="details">
                            <div class="number">
                                     <?php 
echo \app\models\MOrder::getTotalSucceedOrders($target_office);
?>
笔
                            </div>
                            <div class="desc">
                                     成交订单
                            </div>
                    </div>
            </a>        
    </div>
    <?php 
if (NULL !== $target_office) {
    if ($target_office->is_selfOperated != 1) {
        ?>
    <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
Example #8
0
 static function getItemTitle($oid)
 {
     $order = MOrder::findOne(['oid' => $oid]);
     return $order->title;
 }
Example #9
0
          <ul class="table-view">
            <li class="table-view-cell">
                <a class="navigate-right" data-ignore="push" href="<?php 
echo \yii\helpers\Url::to(['client-order-list', 'gh_id' => $wx_user->gh_id, 'openid' => $wx_user->openid, 'backwards' => true, 'ClientOrderSearch' => ['office_id' => $outlet->original_office_id, 'create_time' => date('Y-m-d', strtotime("-14 days"))]]);
?>
">
                    <span class="badge badge-negative">
                    <?php 
if (empty($outlet->original_office_id)) {
    ?>
                            0
                    <?php 
} else {
    ?>
                        <?php 
    echo \app\models\MOrder::getOfficeOrderInfoCount($outlet->original_office_id);
    ?>
                    <?php 
}
?>
                    </span>
                    门店订单
                </a>
            </li>
            <li class="table-view-cell">
                <a class="navigate-right" data-ignore="push" href="<?php 
echo \yii\helpers\Url::to(['client-wechat-fan-list', 'gh_id' => $wx_user->gh_id, 'openid' => $wx_user->openid, 'backwards' => true, 'ClientWechatFanSearch' => ['gh_id' => $wx_user->gh_id, 'office_id' => $outlet->original_office_id]]);
?>
">
                    <span class="badge badge-primary"><?php 
echo \app\models\MUser::getBoundWechatFanCount($wx_user->gh_id, $outlet->original_office_id);
Example #10
0
 public function NotifyProcess($data, &$msg)
 {
     //U::W([__METHOD__, $data, $msg]);
     $notfiyOutput = array();
     if (!array_key_exists("transaction_id", $data)) {
         $msg = "输入参数不正确";
         return false;
     }
     if (!$this->Queryorder($data["transaction_id"])) {
         $msg = "订单查询失败";
         return false;
     }
     $order = MOrder::findOne($data["out_trade_no"]);
     $status_old = $order->status;
     $pay_kind_old = $order->pay_kind;
     $order->status = MOrder::STATUS_PAID;
     $order->partner = $data['mch_id'];
     $order->time_end = $data['time_end'];
     $order->total_fee = $data['total_fee'];
     $order->transaction_id = $data['transaction_id'];
     $order->appid_recv = $data['appid'];
     $order->openid_recv = $data['openid'];
     $order->issubscribe_recv = $data['is_subscribe'];
     $order->pay_kind = MOrder::PAY_KIND_WECHAT;
     if ($order->save(false)) {
         $orderTrail = new MOrderTrail();
         $orderTrail->oid = $order->oid;
         $orderTrail->status_old = $status_old;
         $orderTrail->status_new = $order->status;
         $orderTrail->pay_kind_old = $pay_kind_old;
         $orderTrail->pay_kind_new = $order->pay_kind;
         $orderTrail->save(false);
     }
     return true;
 }
Example #11
0
 public function actionClientOrder($gh_id, $openid, $backwards = true, $pop = false)
 {
     if (!$backwards) {
         \app\models\utils\BrowserHistory::delete($gh_id, $openid);
         \app\models\utils\BrowserHistory::push($gh_id, $openid);
     } else {
         if ($pop) {
             \app\models\utils\BrowserHistory::pop($gh_id, $openid);
         } else {
             \app\models\utils\BrowserHistory::push($gh_id, $openid);
         }
     }
     $wx_user = \app\models\MUser::findOne(['gh_id' => $gh_id, 'openid' => $openid]);
     $this->layout = false;
     $office_id = $_GET['office_id'];
     $office = MOffice::findOne(['office_id' => $office_id]);
     $staff_id = $_GET['staff_id'];
     $staff = MStaff::findOne(['staff_id' => $staff_id]);
     $oid = $_GET['oid'];
     $order = MOrder::findOne(['oid' => $oid]);
     return $this->render('client-order', ['wx_user' => $wx_user, 'backwards' => $backwards, 'office' => $office, 'staff' => $staff, 'order' => $order]);
 }
Example #12
0
 public static function zujieAjax($goods_id, $user_id)
 {
     $goods = MGoods::findOne(['goods_id' => $goods_id]);
     $user = User::findOne(['id' => $user_id]);
     U::W($goods);
     $order = new MOrder();
     if (empty($goods) || empty($user)) {
         U::W("----------goods or user is null--------");
         return \yii\helpers\Json::encode(['code' => 1]);
     }
     $order->oid = uniqid();
     $order->feesum = 0;
     $order->status = 1;
     $order->goods_id = $goods->goods_id;
     $order->title = $goods->title;
     $order->userid = $user->id;
     $order->username = $user->username;
     $order->usermobile = $user->mobile;
     $order->address = "--";
     $order->memo = "--";
     $order->memo_reply = "--";
     $order->save(false);
     return \yii\helpers\Json::encode(['code' => 0]);
 }
Example #13
0
	callshowPack_name = <?php 
echo \app\models\MOrder::getCallShowPackName();
?>
;
	callshowPack_fee =<?php 
echo \app\models\MOrder::getCallShowPackFee();
?>
;

    otherPack_name = <?php 
echo \app\models\MOrder::getOtherPackName();
?>
;
    otherPack_fee =<?php 
echo \app\models\MOrder::getOtherPackFee();
?>
;

    office_name = <?php 
echo \app\models\MOffice::getOfficeNameOption($gh_id);
?>
;

	var item = localStorage.getItem("item");
	item_new = item.replace(/&/g, ";") +';';

	eval(item_new);
	//alert('流量包'+flowPack_name[flowPack]+"费用"+flowPack_fee[flowPack]);
	
	$("#flowPack_name").html(flowPack_name[flowPack]);
Example #14
0
    <//?= $form->field($model, 'oid')->textInput(['maxlength' => true]) ?>
    -->

    <!--
    <//?= $form->field($model, 'feesum')->textInput() ?>

    <//?= $form->field($model, 'create_time')->textInput() ?>
    -->

    <!--
    <//?= $form->field($model, 'status')->textInput() ?>
    -->


    <?php 
echo $form->field($model, 'status')->dropDownList(MOrder::getStatusOption());
?>

    <!--
    <//?= $form->field($model, 'goods_id')->textInput() ?>

    <//?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <//?= $form->field($model, 'userid')->textInput() ?>

    <//?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>

    <//?= $form->field($model, 'usermobile')->textInput(['maxlength' => true]) ?>

    <//?= $form->field($model, 'address')->textInput(['maxlength' => true]) ?>
Example #15
0
 public static function closeExpiredOrders()
 {
     $tableName = MOrder::tableName();
     $n = Yii::$app->db->createCommand()->delete($tableName, 'status=:status AND create_time < DATE_SUB(NOW(), INTERVAL 2 day)', [':status' => MOrder::STATUS_DRAFT])->execute();
     U::W("UPDATE {$tableName}, {$n} --- 系统删除2天前的僵死订单。");
     // auto close the orders exceed 2 days
     $n = Yii::$app->db->createCommand()->update($tableName, ['status' => MOrder::STATUS_SYSTEM_CLOSED], 'status=:status AND create_time < DATE_SUB(NOW(), INTERVAL 2 day)', [':status' => MOrder::STATUS_SUBMITTED])->execute();
     U::W("UPDATE {$tableName}, {$n} --- 系统自动关闭超时2天的提交订单。");
     $n = Yii::$app->db->createCommand()->update($tableName, ['status' => MOrder::STATUS_SYSTEM_SUCCEEDED], 'status=:status AND create_time < DATE_SUB(NOW(), INTERVAL 2 day)', [':status' => MOrder::STATUS_FULFILLED])->execute();
     U::W("UPDATE {$tableName}, {$n} --- 系统自动确认超时2天的已办理订单。");
     //找到超时2天的成功订单, 将其归属的渠道 +积分100
     $orders = MOrder::find()->where(['status' => MOrder::STATUS_FULFILLED])->andWhere(['<', 'create_time', 'DATE_SUB(NOW(), INTERVAL 2 day)'])->all();
     foreach ($orders as $order) {
         $user = MUser::findOne(['openid' => $order->openid]);
         $office = MOffice::findOne(['office_id' => $user->belongto]);
         if ($office->is_selfOperated == 0) {
             //wx_office_score_event 增加一条记录
             $offce_score_event = new MOfficeScoreEvent();
             $offce_score_event->gh_id = $order->gh_id;
             $offce_score_event->openid = $order->openid;
             $offce_score_event->office_id = $user->belongto;
             $offce_score_event->cat = MOfficeScoreEvent::CAT_ADD_ORDER;
             $offce_score_event->create_time = date('y-m-d h:i:s', time());
             $offce_score_event->score = MOfficeScoreEvent::CAT_ADD_ORDER_SCORE;
             $offce_score_event->memo = '会员订单';
             $offce_score_event->save(false);
             //wx_office表中对应渠道score 加100分
             $office->score = $office->score + 100;
             $office->save(false);
         }
     }
     /* 		
      //move the unsuccessful orders exceed 90 days to bak table
      $n = Yii::$app->db->createCommand("INSERT INTO {$tableName}_arc SELECT * FROM $tableName WHERE status!=:status AND create_time < DATE_SUB(NOW(), INTERVAL 90 day)", [':status'=>MOrder::STATUS_OK])->execute();
      U::W("INSERT $tableName, $n");
     
      $n = Yii::$app->db->createCommand("DELETE FROM $tableName WHERE status!=:status AND create_time < DATE_SUB(NOW(), INTERVAL 90 day)", [':status'=>MOrder::STATUS_OK])->execute();
      U::W("DELETE $tableName, $n");
     */
     //release mobile number
     $tableName = MMobnum::tableName();
     $n = Yii::$app->db->createCommand()->update($tableName, ['status' => MMobnum::STATUS_UNUSED, 'locktime' => 0], 'status=:status AND locktime < :locktime', [':status' => MMobnum::STATUS_LOCKED, ':locktime' => time() - 2 * 24 * 3600])->execute();
     U::W("UPDATE {$tableName}, {$n}");
     $n = Yii::$app->db->createCommand("DELETE FROM {$tableName} WHERE status=:status", [':status' => MMobnum::STATUS_USED])->execute();
     U::W("DELETE {$tableName}, {$n}");
 }
Example #16
0
 public function actionOrder($filename = 'order.csv', $date = null)
 {
     $filepathname = Yii::$app->getRuntimePath() . DIRECTORY_SEPARATOR . 'exported_data' . DIRECTORY_SEPARATOR . $filename;
     $fh = fopen($filepathname, 'w');
     if (null === $date) {
         $date = \app\models\U::getFirstDate(date('Y'), date('m'));
     }
     $total_count = \app\models\MOrder::find()->where(['>', 'create_time', $date])->count();
     //$total_count = \app\models\MUser::find()->count();
     $step = 300;
     $start = 0;
     while ($start < $total_count) {
         $orders = \app\models\MOrder::find()->offset($start)->limit($step)->where(['>', 'create_time', $date])->orderBy(['create_time' => SORT_ASC])->all();
         fprintf($fh, "营业厅, 订单号, 商品, 价格, 订单时间, 身份证, 用户姓名, 联系电话, 支付方式, 订单状态, 开通, 备注, 用户类型\n");
         foreach ($orders as $order) {
             $office = \app\models\MOffice::findOne(['office_id' => $order->office_id]);
             if (!empty($office)) {
                 $office_title = $office->title;
             } else {
                 $office_title = "";
             }
             $user = \app\models\MUser::findOne(['openid' => $order->openid]);
             $customerFlag = '--';
             /*
             if ($user->bindMobileIsInside('wx_t1')) {
                 $customerFlag = '老';
             } elseif ($user->bindMobileIsInside('wx_t2')) {
                 $customerFlag = '老';
             }elseif ($user->bindMobileIsInside('wx_t3')) {
                 $customerFlag = '老';
             } else {
                 $customerFlag = '新';
             }
             */
             if ($user->bindMobileIsInside('wx_oldcustomer')) {
                 $customerFlag = '老';
             } else {
                 $customerFlag = '新';
             }
             $pay_kind = \app\models\MOrder::getOrderPayKindOption($order->pay_kind);
             $price = $order->feesum / 100;
             $paystatus = \app\models\MOrder::getOrderStatusName($order->status);
             //echo $office_title."\t".$order->oid."\t".$order->title."\t".$price."\t".$order->create_time."\t".$order->userid."\t".$order->username."\t".$order->usermobile."\t".$pay_kind."\t".$order->memo."\t".$order->customerFlag."\t\n";
             fprintf($fh, "%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s\n", $office_title, $order->oid, $order->title, $price, $order->create_time, $order->userid, $order->username, $order->usermobile, $pay_kind, $paystatus, $order->kaitong, $order->memo, $order->customerFlag);
         }
         $start += $step;
     }
     fclose($fh);
 }
Example #17
0
 public function actionOrderinfotest()
 {
     $this->layout = 'wapy';
     $gh_id = U::getSessionParam('gh_id');
     $openid = U::getSessionParam('openid');
     $oid = '55306A960191B';
     $model = MOrder::findOne($oid);
     $item = MItem::findOne(['gh_id' => $gh_id, 'cid' => $model->cid]);
     $input = new WxPayUnifiedOrder();
     $input->SetBody("test");
     $input->SetAttach("test");
     $input->SetOut_trade_no(WxPayConfig::MCHID . date("YmdHis"));
     $input->SetTotal_fee("1");
     $input->SetTime_start(date("YmdHis"));
     $input->SetTime_expire(date("YmdHis", time() + 600));
     $input->SetGoods_tag("test");
     $input->SetNotify_url("http://wosotech.com/wx/web/wxpaynotify.php");
     $input->SetTrade_type("JSAPI");
     $input->SetOpenid($openid);
     $unifiedOrder = WxPayApi::unifiedOrder($input);
     U::W($unifiedOrder);
     $jsApiParameters = $this->GetJsApiParameters($unifiedOrder);
     U::W($jsApiParameters);
     return $this->render('orderinfo', ['gh_id' => $gh_id, 'openid' => $openid, 'model' => $model, 'item' => $item, 'jsApiParameters' => $jsApiParameters]);
 }
Example #18
0
 protected function findModel($id)
 {
     if (($model = MOrder::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #19
0
    <?php 
$columns = ['oid', ['label' => '营业厅', 'attribute' => 'office.title', 'value' => function ($model, $key, $index, $column) {
    return empty($model->office->title) ? '' : $model->office->title;
}, 'filter' => false, 'headerOptions' => array('style' => 'width:80px;')], ['label' => '微信昵称', 'value' => function ($model, $key, $index, $column) {
    $user = $model->user;
    return empty($user) ? '' : $user->nickname;
}, 'filter' => false, 'headerOptions' => array('style' => 'width:80px;')], ['attribute' => 'detail', 'headerOptions' => array('style' => 'width:100px;')], ['attribute' => 'feesum', 'value' => function ($model, $key, $index, $column) {
    return "¥" . sprintf("%0.2f", $model->feesum / 100);
}], ['attribute' => 'create_time', 'filterType' => GridView::FILTER_DATE, 'format' => 'raw', 'width' => '250px', 'filterWidgetOptions' => ['type' => \kartik\widgets\DatePicker::TYPE_RANGE, 'separator' => '至', 'attribute2' => 'create_time_2', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'language' => 'zh-CN']]], ['label' => '买家身份信息', 'value' => function ($model, $key, $index, $column) {
    return "{$model->username}, {$model->userid}, {$model->usermobile}";
}, 'headerOptions' => array('style' => 'width:120px;')], ['label' => '留言', 'attribute' => 'memo'], ['label' => '备注', 'attribute' => 'memo_reply'], ['attribute' => 'status', 'value' => function ($model, $key, $index, $column) {
    return $model->statusName;
}, 'filter' => MOrder::getOrderStatusName()], ['attribute' => 'pay_kind', 'label' => '付款方式', 'value' => function ($model, $key, $index, $column) {
    return MOrder::getOrderPayKindOption($model->pay_kind);
}, 'filter' => MOrder::getOrderPayKindOption(), 'headerOptions' => array('style' => 'width:60px;')], ['label' => '用户', 'value' => function ($model, $key, $index, $column) {
    if (!empty($model->user)) {
        if ($model->user->bindMobileIsInside('wx_vip')) {
            return '老';
        } else {
            return '新';
        }
    }
    return '--';
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update} {chat}', 'buttons' => ['chat' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-comment"></span>', $url, ['title' => Yii::t('yii', '发送消息给用户'), 'data-method' => 'post', 'data-pjax' => '0']);
}]]];
/*		
	echo DynaGrid::widget([
		'columns'=>$columns,
		'storage'=>DynaGrid::TYPE_COOKIE,
Example #20
0
        <span>
          <ul class="table-view">

            <li class="table-view-cell media">
              <a data-ignore="push" class="navigate-right" href="<?php 
echo Url::to(['officeorder', 'gh_id' => $user->gh_id, 'openid' => $user->openid, 'staff_id' => $staff->staff_id]);
?>
">

                <?php 
if (MOrder::getOfficeOrderInfoCount($staff->office_id) > 0) {
    ?>
                  <span class="badge badge-negative">
                  <?php 
    echo MOrder::getOfficeOrderInfoCount($staff->office_id);
    ?>
                  </span>
                <?php 
}
?>

                <span class="media-object pull-left icon icon-list" style="color:#428bca"></span>
                <div class="media-body">
                  营业厅订单
                </div>
              </a>
            </li>
 
 <!--
    const GH_XIANGYANGUNICOM_OPENID_HBHE = 'oKgUduNHzUQlGRIDAghiY7ywSeWk';
Example #21
0
?>

		<?php 
echo $form->field($model, 'select_mobnum')->textInput(['maxlength' => 24]);
?>

		<?php 
echo $form->field($model, 'memo_reply')->textInput(['maxlength' => 100]);
?>

		<?php 
echo $form->field($model, 'status')->dropDownList(MOrder::getOrderStatusOptionForOffice());
?>

		<?php 
echo $form->field($model, 'wlgs')->dropDownList(MOrder::getOrderWuliugongsiName());
?>

		<?php 
echo $form->field($model, 'wldh')->textInput(['maxlength' => 100]);
?>


		<div class="form-group">
			<?php 
echo Html::submitButton($model->isNewRecord ? '创建' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
		</div>

		<?php 
ActiveForm::end();
Example #22
0
?>
                      &nbsp;&nbsp;
                      <?php 
if ($order->buyerCanPay()) {
    echo "<span class='btn' id='xianxia_pay' oid=" . $order->oid . " status=" . MOrder::PAY_KIND_CASH . ">线下支付</span>";
}
?>
                </span>


            </li>

            <li class="table-view-cell"><span class="orderitem">订单状态</span>&nbsp;&nbsp; 

              <?php 
echo MOrder::getOrderStatusName($order->status);
?>

              <?php 
if ($order->buyerCanCancel()) {
    echo "<span class='btn btn-negative' id='qxdd_attr' oid=" . $order->oid . " status=" . MOrder::STATUS_BUYER_CLOSED . ">取消订单</span>";
}
?>

              <?php 
if ($order->buyerCanRefund()) {
    echo "<span class='btn btn-negative' id='tk_attr' oid=" . $order->oid . " status=" . MOrder::STATUS_BUYER_REFUND_CLOSED . ">退款</span>";
}
?>

              <?php 
Example #23
0
 public function getOrder()
 {
     return $this->hasOne(MOrder::className(), ['oid' => 'oid']);
 }
Example #24
0
    <h4><?php 
echo Html::encode($this->title);
?>
</h4>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <!--
    <p>
        <//?= Html::a('Create Morder', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    -->
    <p>
    <?php 
echo Html::a('下载 <i class="glyphicon glyphicon-arrow-down"></i>', U::current(['download' => 1]), ['class' => 'btn btn-success', 'data-pjax' => '0']);
?>
    </p>
    
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showOnEmpty' => false, 'tableOptions' => ['class' => 'table table-striped'], 'columns' => ['oid', 'title', ['visible' => $isAdmin, 'attribute' => 'username'], ['visible' => $isAdmin, 'attribute' => 'usermobile'], 'create_time', ['attribute' => 'status', 'label' => '订单状态', 'value' => function ($model, $key, $index, $column) {
    return MOrder::getStatusOption($model->status);
}, 'filter' => MOrder::getStatusOption(), 'headerOptions' => array('style' => 'width:90px;')], ['class' => 'yii\\grid\\ActionColumn', 'headerOptions' => array('style' => 'width:90px;'), 'template' => $opt, 'buttons' => ['update' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0']);
}, 'delete' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', '确认要删除?'), 'data-method' => 'post', 'data-pjax' => '0']);
}]]]]);
?>

</div>
Example #25
0
 public function getOrderInfoCount()
 {
     $sql = "select * from " . MOrder::tableName() . " where gh_id='" . $this->gh_id . "' and openid='" . $this->openid . "' and (status =" . MOrder::STATUS_SUBMITTED . " or status =" . MOrder::STATUS_PAID . " or status =" . MOrder::STATUS_FULFILLED . ") and create_time > DATE_SUB(NOW(), INTERVAL 1 month) order by create_time DESC";
     return count(Morder::findBySql($sql)->all());
     //        return $this->hasMany(MOrder::className(), ['gh_id'=>'gh_id', 'openid'=>'openid']);
 }