settter
parent
c9c145607f
commit
cb550401ba
|
@ -453,7 +453,7 @@ class Coupon extends Base
|
|||
Deduction::create($deductionData);
|
||||
|
||||
//4. 商家扣钱
|
||||
$business->save(["balance"=>Db::raw("balance - {$deductionMoney}")]);
|
||||
$business->save(["balance"=>Db::raw("balance - " . $deductionMoney)]);
|
||||
|
||||
//5. 渠道商加钱
|
||||
if(isset($business->agency) && $business->agency){
|
||||
|
@ -506,6 +506,7 @@ class Coupon extends Base
|
|||
Db::rollback();
|
||||
return $this->json(5001, "Repository服务器错误");
|
||||
}catch (\Exception $e){
|
||||
echo $e->getMessage();
|
||||
Db::rollback();
|
||||
return $this->json(5002, "服务器错误");
|
||||
}
|
||||
|
|
|
@ -39,7 +39,9 @@ class Business extends Base
|
|||
$page = $this->request->param('page/d', 1);
|
||||
$size = $this->request->param('size/d', 30);
|
||||
|
||||
$whereMap = [["a.state", "=", BusinessModel::state_on]];
|
||||
$whereMap = [
|
||||
["a.state", "=", BusinessModel::state_on]
|
||||
];
|
||||
$orders = ['a.id' => 'desc'];
|
||||
if (!empty($keyword)) {
|
||||
$whereMap[] = ['b.nick_name|a.business_name|a.business_subtitle', 'like', "%$keyword%"];
|
||||
|
|
|
@ -30,7 +30,9 @@ class Consumer extends Base
|
|||
$page = $this->request->param('page/d', 1);
|
||||
$size = $this->request->param('size/d', 30);
|
||||
|
||||
$whereMap = [["type", "=", Account::type_consumer]];
|
||||
$whereMap = [
|
||||
["type", "<>", Account::type_business]
|
||||
];
|
||||
$orders = ['id' => 'desc'];
|
||||
if (!empty($keyword)) {
|
||||
$whereMap[] = ['nick_name', 'like', "%$keyword%"];
|
||||
|
@ -132,7 +134,7 @@ class Consumer extends Base
|
|||
$size = $this->request->param('size/d', 30);
|
||||
|
||||
$whereMap = [
|
||||
["type", "=", Account::type_consumer],
|
||||
//["type", "=", Account::type_consumer],
|
||||
["blank_total", ">", 0],
|
||||
];
|
||||
$orders = ['id' => 'desc'];
|
||||
|
|
|
@ -44,7 +44,7 @@ class BillRepository extends Repository
|
|||
->join("account c", "a.user_code = c.user_code")
|
||||
->join("coupon_main d", "a.coupon_main_id = d.id")
|
||||
->when(!empty($keyword), function ($q) use ($keyword) {
|
||||
$q->where("b.business_name|c.nick_name|d.name", "like", "%$keyword%");
|
||||
$q->where("b.business_name|c.nick_name|d.name", "like", "%{$keyword}%");
|
||||
})
|
||||
->when(!empty($businessCode), function ($q) use ($businessCode) {
|
||||
$q->where("b.code", "=", $businessCode);
|
||||
|
@ -93,10 +93,10 @@ class BillRepository extends Repository
|
|||
$q->where("business_code", "=", $businessCode);
|
||||
})
|
||||
->when(!empty($startTime), function ($q) use ($startTime) {
|
||||
$q->whereTime("create_time", ">=", $startTime);
|
||||
$q->whereTime("create_time", ">=", $startTime . "00:00:00");
|
||||
})
|
||||
->when(!empty($endTime), function ($q) use ($endTime) {
|
||||
$q->whereTime("create_time", "<=", $endTime);
|
||||
$q->whereTime("create_time", "<=", $endTime . "23:59:59");
|
||||
});
|
||||
;
|
||||
$failData["total"] = $rep->count();
|
||||
|
@ -249,7 +249,7 @@ class BillRepository extends Repository
|
|||
->join("account c", "a.user_code = c.user_code")
|
||||
->join("coupon_main d", "a.coupon_main_id = d.id")
|
||||
->when(!empty($keyword), function ($q) use ($keyword) {
|
||||
$q->whereTime("c.business_name|e.business_name", "like", "%" . $keyword . "%");
|
||||
$q->where("b.business_name|c.nick_name|d.name", "like", "%{$keyword}%");
|
||||
})
|
||||
->when(!empty($start_time), function ($q) use ($start_time) {
|
||||
$q->whereTime("a.create_time", ">=", $start_time);
|
||||
|
@ -277,10 +277,10 @@ class BillRepository extends Repository
|
|||
->join("coupon_main b", "a.coupon_main_id = b.id")
|
||||
->where("a.business_code",$businessCode)
|
||||
->when(!empty($startTime), function ($q) use ($startTime) {
|
||||
$q->whereTime("a.create_time", ">=", $startTime);
|
||||
$q->whereTime("a.create_time", ">=", $startTime. "00:00:00");
|
||||
})
|
||||
->when(!empty($endTime), function ($q) use ($endTime) {
|
||||
$q->whereTime("a.create_time", "<=", $endTime);
|
||||
$q->whereTime("a.create_time", "<=", $endTime. "23:59:59");
|
||||
})
|
||||
->sum("b.deduction_money");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue