Browse Source

管理后台-快递列表bug

master
Fanli2012 5 years ago
parent
commit
330a9fc915
  1. 34
      app/Http/Logic/OrderLogic.php
  2. 3
      app/Http/Logic/UserMoneyLogic.php
  3. 1
      app/Http/Model/Comment.php
  4. 2
      app/Http/Model/Kuaidi.php
  5. 3
      resources/views/admin/index/index.blade.php
  6. 3
      resources/views/home/index/index.blade.php
  7. 2
      resources/views/weixin/feedback/userFeedbackAdd.blade.php
  8. 3
      resources/views/weixin/index/index.blade.php
  9. 2
      resources/views/weixin/user/userWithdraw.blade.php

34
app/Http/Logic/OrderLogic.php

@ -305,8 +305,8 @@ class OrderLogic extends BaseLogic
/**
* 订单-余额支付
* @param int $data['id'] 订单id
* @param int $data['user_id'] 用户id
* @param int $where['id'] 订单id
* @param int $where['user_id'] 用户id
* @return array
*/
public function orderYuepay($where = array())
@ -318,6 +318,14 @@ class OrderLogic extends BaseLogic
$order = $this->getModel()->getOne($where);
if(!$order){return ReturnData::create(ReturnData::PARAMS_ERROR,null,'订单不存在');}
//获取用户余额信息
$user = model('User')->getOne(array('id'=>$where['user_id']));
if(!$user){return ReturnData::create(ReturnData::PARAMS_ERROR,null,'用户不存在');}
if($user->money < $order->order_amount)
{
return ReturnData::create(ReturnData::PARAMS_ERROR, null, '余额不足');
}
DB::beginTransaction();
$data['pay_status'] = 1;
@ -326,20 +334,20 @@ class OrderLogic extends BaseLogic
$data['pay_time'] = time();
$data['updated_at'] = time();
$res = $this->getModel()->edit($data,$where);
if($res)
if(!$res)
{
$user_money_data['user_id'] = $where['user_id'];
$user_money_data['type'] = 1;
$user_money_data['money'] = $order->order_amount;
$user_money_data['des'] = '订单余额支付';
if(!logic('UserMoney')->add($user_money_data)){DB::rollBack();}
DB::commit();
return ReturnData::create(ReturnData::SUCCESS,$res,'支付成功');
DB::rollBack();
return ReturnData::create(ReturnData::FAIL);
}
DB::rollBack();
return ReturnData::create(ReturnData::FAIL);
$user_money_data['user_id'] = $where['user_id'];
$user_money_data['type'] = 1;
$user_money_data['money'] = $order->order_amount;
$user_money_data['des'] = '订单余额支付';
if(!logic('UserMoney')->add($user_money_data)){ DB::rollBack(); return ReturnData::create(ReturnData::FAIL); }
DB::commit();
return ReturnData::create(ReturnData::SUCCESS,$res,'支付成功');
}
/**

3
app/Http/Logic/UserMoneyLogic.php

@ -130,13 +130,14 @@ class UserMoneyLogic extends BaseLogic
$user_money = model('User')->getDb()->where(array('id'=>$data['user_id']))->value('money'); //用户余额
$data['user_money'] = $user_money;
$res = $this->getModel()->add($data,$type);
$res = $this->getModel()->add($data, $type);
if($res)
{
DB::commit(); //事务提交
return ReturnData::create(ReturnData::SUCCESS,$res);
}
DB::rollBack(); //事务回滚
return ReturnData::create(ReturnData::FAIL);
}

1
app/Http/Model/Comment.php

@ -17,7 +17,6 @@ class Comment extends BaseModel
const GOODS_COMMENT_TYPE = 0; //商品评论
const ARTICLE_COMMENT_TYPE = 1; //文章评论
public function getDb()
{
return DB::table($this->table);

2
app/Http/Model/Kuaidi.php

@ -166,6 +166,6 @@ class Kuaidi extends BaseModel
public function getStatusAttr($data)
{
$arr = array(0 => '显示', 1 => '不显示');
return $arr[$data['status']];
return $arr[$data->status];
}
}

3
resources/views/admin/index/index.blade.php

@ -74,4 +74,7 @@ $(document).ready(function(){
</script>
<iframe src="<?php echo route('admin_welcome'); ?>" frameborder="0" scrolling="yes" width="100%" height="100%" allowtransparency="true" id="appiframe" name="appiframe"></iframe>
</div></div><!-- 右边结束 --></div></div>
<script>
console.log("Github地址:https://github.com/Fanli2012/lqycms\nEmail:374861669@qq.com");
</script>
</body></html>

3
resources/views/home/index/index.blade.php

@ -191,5 +191,8 @@ $(function(){
});
</script>
<script>
console.log("Github地址:https://github.com/Fanli2012/lqycms\nEmail:374861669@qq.com");
</script>
@include('home.common.footer')
</body></html>

2
resources/views/weixin/feedback/userFeedbackAdd.blade.php

@ -32,7 +32,7 @@
</select>
</div>
<div class="adr-form-group">
<label for="doc-ta-1" style="border-left:2px solid #f23030;padding-left:4px;margin-bottom:2px;">详细地址(必填)</label>
<label for="doc-ta-1" style="border-left:2px solid #f23030;padding-left:4px;margin-bottom:2px;">反馈内容(必填)</label>
<textarea style="margin-top:4px;" name="content" class="" rows="3" id="content" placeholder="提优质意见可得大礼哦"></textarea>
</div>

3
resources/views/weixin/index/index.blade.php

@ -179,4 +179,7 @@ var swiper = new Swiper('.swiper-nav', {
.banner_tit{font-size:18px;font-weight:400;background-color:#fff;color:#f23030;height:46px;line-height:46px;padding-left:10px;padding-right:10px;border-bottom:1px solid #eee;text-align:center;}
</style>
@include('weixin.common.footer')
<script>
console.log("Github地址:https://github.com/Fanli2012/lqycms\nEmail:374861669@qq.com");
</script>
</body></html>

2
resources/views/weixin/user/userWithdraw.blade.php

@ -68,7 +68,7 @@ function submit()
{
var url = '<?php echo env('APP_API_URL').'/user_withdraw_add'; ?>';
var name = $("#name").val();
var method = $('[name="method"][checked]').val();
var method = $('input[name="method"]:checked').val();
var money = $("#money").val();
var account = $("#account").val();
var bank_name = $("#bank_name").val();

Loading…
Cancel
Save