feat: 修改UserSignLists, UserSignLogLists和UserSignLogic类以实现新的订单处理逻辑
This commit is contained in:
parent
60300206f4
commit
2f443ec364
@ -7,6 +7,8 @@ use app\api\lists\BaseApiDataLists;
|
||||
use app\common\model\user_label\UserLabel;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\logic\UserSignLogic;
|
||||
use app\common\model\store_order\StoreOrder;
|
||||
use app\common\model\user_recharge\UserRecharge;
|
||||
use app\common\model\user_ship\UserShip;
|
||||
use app\common\model\user_sign\UserSign;
|
||||
|
||||
@ -59,7 +61,12 @@ class UserSignLists extends BaseApiDataLists implements ListsSearchInterface
|
||||
$list=UserSign::where($this->searchWhere)->order('id desc')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->select()->each(function ($item){
|
||||
$item['title']=UserSignLogic::getTitle($item['type'],$item['number']);
|
||||
if($item['order_type']==0){
|
||||
$price=UserRecharge::where('order_id',$item['order_id'])->value('price')??0;
|
||||
}else{
|
||||
$price=StoreOrder::where('order_id',$item['order_id'])->value('pay_price')??0;
|
||||
}
|
||||
$item['title']=UserSignLogic::getTitle($item['type'],$price,$item['number']);
|
||||
return $item;
|
||||
});
|
||||
return $list?->toArray();
|
||||
|
@ -7,6 +7,8 @@ use app\api\lists\BaseApiDataLists;
|
||||
use app\common\model\user_label\UserLabel;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\logic\UserSignLogic;
|
||||
use app\common\model\store_order\StoreOrder;
|
||||
use app\common\model\user_recharge\UserRecharge;
|
||||
use app\common\model\user_ship\UserShip;
|
||||
use app\common\model\user_sign_log\UserSignLog;
|
||||
|
||||
@ -58,7 +60,12 @@ class UserSignLogLists extends BaseApiDataLists implements ListsSearchInterface
|
||||
$list=UserSignLog::where($this->searchWhere)->order('id desc')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->select()->each(function ($item){
|
||||
$item['title']=UserSignLogic::getTitle($item['type'],$item['number']);
|
||||
if($item['order_type']==0){
|
||||
$price=UserRecharge::where('order_id',$item['order_id'])->value('price')??0;
|
||||
}else{
|
||||
$price=StoreOrder::where('order_id',$item['order_id'])->value('pay_price')??0;
|
||||
}
|
||||
$item['title']=UserSignLogic::getTitle($item['type'],$price,$item['number']);
|
||||
return $item;
|
||||
});
|
||||
return $list?->toArray();
|
||||
|
@ -244,9 +244,6 @@ class UserLogic extends BaseLogic
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static function dealPayPassword($params,$uid)
|
||||
{
|
||||
$password = payPassword($params['password']);
|
||||
@ -255,49 +252,6 @@ class UserLogic extends BaseLogic
|
||||
|
||||
}
|
||||
|
||||
public static function userSingList($params,$uid)
|
||||
{
|
||||
switch ($params['type']){
|
||||
case 1:
|
||||
$query = UserSign::where(['uid'=>$uid,'type'=>1]);
|
||||
if($params['mark'] == 1){
|
||||
$query->where('financial_pm',1);//获得
|
||||
}
|
||||
if($params['mark'] == 2){
|
||||
$query->where('financial_pm',0);
|
||||
}
|
||||
$count = $query->count();
|
||||
$data =$query
|
||||
->page($params['page_no'],$params['page_size'])
|
||||
->order('id','desc')
|
||||
->select()?->toArray();
|
||||
break;
|
||||
default:
|
||||
$query = UserSign::where(['uid'=>$uid,'type'=>0]);
|
||||
if($params['mark'] == 1){
|
||||
$query->where('financial_pm',1);//获得
|
||||
}
|
||||
if($params['mark'] == 2){
|
||||
$query->where('financial_pm',0);
|
||||
}
|
||||
$count = $query->count();
|
||||
$data =$query
|
||||
->page($params['page_no'],$params['page_size'])
|
||||
->order('id','desc')
|
||||
->select()?->toArray();
|
||||
}
|
||||
foreach ($data as &$value){
|
||||
if(!preg_match('/[\x{4e00}-\x{9fa5}]/u', $value['title'])){
|
||||
$value['title'] = UserSignLogic::getTitle($value['title'],$value['number']);
|
||||
}
|
||||
}
|
||||
return [
|
||||
'lists' => $data,
|
||||
'count' => $count
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public static function dealDetails($params,$uid)
|
||||
{
|
||||
switch ($params['type']){
|
||||
|
@ -142,33 +142,33 @@ class UserSignLogic extends BaseLogic
|
||||
}
|
||||
|
||||
//礼品券相关对应文本
|
||||
public static function getTitle($type, $amount)
|
||||
public static function getTitle($type, $amount,$number)
|
||||
{
|
||||
switch ($type) {
|
||||
/**冻结券**/
|
||||
//收入
|
||||
case 1:
|
||||
return "购买商品{$amount}元获得冻结券";
|
||||
return "购买商品{$amount}元获得{$number}元冻结券";
|
||||
case 7:
|
||||
return "充值{$amount}元获得冻结券";
|
||||
return "充值{$amount}元获得{$number}元冻结券";
|
||||
//支出
|
||||
case 2:
|
||||
return "核销商品{$amount}元解冻冻结券";
|
||||
return "核销商品{$amount}元解冻{$number}元礼品券";
|
||||
case 3:
|
||||
return "退款{$amount}元扣除冻结券";
|
||||
return "退款{$amount}元扣除{$number}元冻结券";
|
||||
/**礼品券**/
|
||||
//收入
|
||||
case 4:
|
||||
return "核销金额{$amount}元获得礼品券";
|
||||
return "核销金额{$amount}元获得{$number}元礼品券";
|
||||
//支出
|
||||
case 5:
|
||||
return "兑换{$amount}元商品扣除礼品券";
|
||||
return "兑换{$amount}元商品扣除{$number}元礼品券";
|
||||
case 6:
|
||||
return "退款{$amount}元扣除礼品券";
|
||||
return "退款{$amount}元扣除{$number}元礼品券";
|
||||
case 8:
|
||||
return "收银台支付{$amount}元增加礼品券";
|
||||
return "收银台支付{$amount}元增加{$number}元礼品券";
|
||||
case 9:
|
||||
return "充值{$amount}元获得礼品券";
|
||||
return "充值{$amount}元解冻{$number}元礼品券";
|
||||
default:
|
||||
return "订单支付{$amount}元";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user