From e5bd574091ac5930b2091cfdf6ffe63ec527eaac Mon Sep 17 00:00:00 2001 From: liapples Date: Sat, 11 Sep 2021 15:26:24 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/TestController.php | 35 ++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/app/Http/Controllers/Api/TestController.php b/app/Http/Controllers/Api/TestController.php index 23aa6bb..c88659e 100644 --- a/app/Http/Controllers/Api/TestController.php +++ b/app/Http/Controllers/Api/TestController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api; use App\Models\Order; use App\Models\OrderProductItem; use App\Models\Product; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; /** @@ -14,26 +15,24 @@ use Illuminate\Support\Facades\DB; */ class TestController { - /*public function index() + public function index() { - //test - $ids = Order::orderBy('id')->get(['id AS order_id', 'product_ids', 'agent_id', 'agent_product_id']); - foreach ($ids as $v) { - $item = Product::query()->whereIn('id', explode(',', $v['product_ids'])) - ->orderBy('id')->get(['id AS product_id', 'supplier_id'])->toArray(); - foreach ($item as $v2) { - if (!OrderProductItem::query()->where(['order_id' => $v['order_id'], 'product_id' => $v2['product_id']])->exists()) { - $v2['order_id'] = $v['order_id']; - $v2['agent_id'] = $v['agent_id']; - $v2['agent_product_id'] = $v['agent_product_id']; - OrderProductItem::query()->create($v2); - } - } - } - return ''; - }*/ + return $this->login(2); + } - public function index() + /** + * 模拟登录 + * @param $user_id + * @return string + */ + private function login($user_id) + { + $token_key = md5($user_id . env('APP_KEY')); + Cache::put($token_key, $user_id); + return $token_key; + } + + public function index2() { $handle = fopen(base_path('area.txt'), 'r'); if ($handle) { From b245b4d267df2bdeec5193a2e7575a2e45d4be96 Mon Sep 17 00:00:00 2001 From: liapples Date: Sat, 11 Sep 2021 15:30:15 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0timeout=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminAgent/Controllers/OrderController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/AdminAgent/Controllers/OrderController.php b/app/AdminAgent/Controllers/OrderController.php index 55ec2a0..3d000a2 100644 --- a/app/AdminAgent/Controllers/OrderController.php +++ b/app/AdminAgent/Controllers/OrderController.php @@ -221,7 +221,10 @@ class OrderController extends AdminController if ($form->status !== null) { if (in_array($form->status, [OrderStatus::REFUNDED, OrderStatus::REFUSED_REFUND])) { return $form->response()->error('请通过订单列表的”通过“和”拒绝“按钮来审核退款'); - } else if ($form->status != OrderStatus::OFFLINE_PAID) { + } else if ($form->status == OrderStatus::OFFLINE_PAID) { + $form->hidden('timeout'); + $form->timeout = null; //清空超时时间 + } else { return $form->response()->error('操作禁止'); } } From b9b1037a0f3ac3e988e3e0917beb85c324c8433e Mon Sep 17 00:00:00 2001 From: liapples Date: Sat, 11 Sep 2021 15:30:29 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=B7=B2=E8=AF=BB=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/MessageController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/MessageController.php b/app/Http/Controllers/Api/MessageController.php index 174ba62..ea80140 100644 --- a/app/Http/Controllers/Api/MessageController.php +++ b/app/Http/Controllers/Api/MessageController.php @@ -19,7 +19,7 @@ class MessageController extends Controller $list = Message::query()->where('agent_id', $this->agent_id) ->whereIn('user_id', [$this->user_id, 0]) //0是所有人都接收的系统消息 ->select('id', 'title', 'created_at') - ->selectRaw('IF(( SELECT 1 FROM `message_reads` AS `mr` WHERE mr.id = messages.id AND mr.user_id = messages.user_id ), 1, 0) AS `is_read`') + ->selectRaw('IF((SELECT 1 FROM `message_reads` AS `mr` WHERE mr.id = messages.id AND mr.user_id = ' . $this->user_id . '), 1, 0) AS `is_read`') ->orderBy('id', 'DESC') ->simplePaginate(15); From 9f2e2b10c90bc7dff75e1886287c9bdb102218e8 Mon Sep 17 00:00:00 2001 From: liapples Date: Sat, 11 Sep 2021 16:01:37 +0800 Subject: [PATCH 4/7] =?UTF-8?q?wasChanged=E5=A2=9E=E5=8A=A0extends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminSupplier/Controllers/ProductController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/AdminSupplier/Controllers/ProductController.php b/app/AdminSupplier/Controllers/ProductController.php index fbfc01b..318478e 100644 --- a/app/AdminSupplier/Controllers/ProductController.php +++ b/app/AdminSupplier/Controllers/ProductController.php @@ -225,7 +225,7 @@ class ProductController extends AdminController DB::beginTransaction(); try { //如果修改标题、价格、产品图片、旅游须知、产品详情,状态将变为未审核 - if ($form->model()->wasChanged(['title', 'price', 'original_price', 'pictures', 'know', 'content'])) { + if ($form->model()->wasChanged(['title', 'price', 'original_price', 'pictures', 'know', 'content', 'extends'])) { $form->model()->update(['status' => ProductStatus::UNAUDITED]); //下架所有代理商产品,未审核的产品,不能同步信息到代理商产品 From 8b8d4b6e6584ee721ded19c64dbfdc2f7b615723 Mon Sep 17 00:00:00 2001 From: liapples Date: Sat, 11 Sep 2021 16:04:16 +0800 Subject: [PATCH 5/7] =?UTF-8?q?wasChanged=E5=A2=9E=E5=8A=A0extends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminSupplier/Controllers/ProductController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/AdminSupplier/Controllers/ProductController.php b/app/AdminSupplier/Controllers/ProductController.php index 318478e..f053193 100644 --- a/app/AdminSupplier/Controllers/ProductController.php +++ b/app/AdminSupplier/Controllers/ProductController.php @@ -190,7 +190,7 @@ class ProductController extends AdminController }); if ($form->isEditing()) { - $form->confirm('提示', '修改标题、价格、产品图片、旅游须知、产品详情需要重新审核,同时下架所有关联的代理商产品,是否继续?'); + $form->confirm('提示', '修改标题、价格、产品图片、旅游须知、产品详情、产品类型及信息需要重新审核,同时下架所有关联的代理商产品,是否继续?'); } })->saving(function (Form $form) { //不允许编辑非自己数据 From 9db0d9b236c2fd95de7146bf6565029e44298c4f Mon Sep 17 00:00:00 2001 From: lemon <15040771@qq.com> Date: Sat, 11 Sep 2021 16:04:53 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=88=86=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DemandBiddingController.php | 12 + .../Controllers/DemandController.php | 9 +- .../Extensions/Grid/ChooseDemand.php | 1 + .../Controllers/DemandBiddingController.php | 12 + .../Controllers/DemandController.php | 10 +- .../Controllers/DemandBiddingController.php | 10 +- .../Controllers/DemandController.php | 11 +- app/Common/StatementType.php | 25 + app/Http/Controllers/Api/OrderController.php | 1 + .../Api/VerificationController.php | 203 ++++++- app/Models/Agent.php | 6 + app/Models/Guide.php | 7 + app/Models/Order.php | 10 + app/Models/Statement.php | 20 + app/Models/StatementAdmin.php | 18 + app/Models/Supplier.php | 6 + ...10_165104_create_statement_admin_table.php | 37 ++ ...10_175611_create_statement_agent_table.php | 37 ++ dcat_admin_ide_helper.php | 536 ++++++++++-------- 19 files changed, 711 insertions(+), 260 deletions(-) create mode 100644 app/Common/StatementType.php create mode 100755 app/Models/Statement.php create mode 100755 app/Models/StatementAdmin.php create mode 100755 database/migrations/2021_09_10_165104_create_statement_admin_table.php create mode 100755 database/migrations/2021_09_10_175611_create_statement_agent_table.php diff --git a/app/AdminAgent/Controllers/DemandBiddingController.php b/app/AdminAgent/Controllers/DemandBiddingController.php index dd69ca9..c90238c 100755 --- a/app/AdminAgent/Controllers/DemandBiddingController.php +++ b/app/AdminAgent/Controllers/DemandBiddingController.php @@ -84,6 +84,18 @@ class DemandBiddingController extends AdminController protected function form() { return Form::make(new DemandBidding(), function (Form $form) { + $demand_id = request('demand_id'); + + $isBidding = \App\Models\DemandBidding::query() + ->where('demand_id',$demand_id) + ->where([ + 'bidding_user_type' => DemandTraits::$col[0], + 'bidding_user_id' => Admin::user()->id + ]) + ->exists(); + if ($demand_id && $isBidding) { + Admin::exit('你已经竞标过了,无需重复参加'); + } $form->disableEditingCheck(); $form->disableCreatingCheck(); $form->disableViewCheck(); diff --git a/app/AdminAgent/Controllers/DemandController.php b/app/AdminAgent/Controllers/DemandController.php index 67f182c..defb902 100755 --- a/app/AdminAgent/Controllers/DemandController.php +++ b/app/AdminAgent/Controllers/DemandController.php @@ -81,7 +81,14 @@ class DemandController extends AdminController }else{ $grid->column('bidding','竞标') ->if(function (){ - return $this->state == 1 && $this->bidding_user_type == Arr::first(DemandTraits::$col); + $isBidding = DemandBidding::query() + ->where('demand_id',$this->id) + ->where([ + 'bidding_user_type' => DemandTraits::$col[0], + 'bidding_user_id' => Admin::user()->id + ]) + ->doesntExist(); + return $this->state == 1 && $this->bidding_user_type == Arr::first(DemandTraits::$col) && $isBidding; }) ->then(function (Grid\Column $column) { $column->append('发起竞标'); diff --git a/app/AdminAgent/Extensions/Grid/ChooseDemand.php b/app/AdminAgent/Extensions/Grid/ChooseDemand.php index f76d1cc..90c380d 100644 --- a/app/AdminAgent/Extensions/Grid/ChooseDemand.php +++ b/app/AdminAgent/Extensions/Grid/ChooseDemand.php @@ -62,6 +62,7 @@ class ChooseDemand extends RowAction if ($demand->bidding_user_type == DemandTraits::$col[2]){ $agentProduct = AgentProduct::find($demand->agent_product_id); $agentProduct->guide_id = $demandBidding->bidding_user_id; + $agentProduct->guide_price = $demandBidding->price; $agentProduct->save(); } DB::commit(); diff --git a/app/AdminGuide/Controllers/DemandBiddingController.php b/app/AdminGuide/Controllers/DemandBiddingController.php index f2fcfe7..8331821 100755 --- a/app/AdminGuide/Controllers/DemandBiddingController.php +++ b/app/AdminGuide/Controllers/DemandBiddingController.php @@ -84,6 +84,18 @@ class DemandBiddingController extends AdminController protected function form() { return Form::make(new DemandBidding(), function (Form $form) { + $demand_id = request('demand_id'); + + $isBidding = \App\Models\DemandBidding::query() + ->where('demand_id',$demand_id) + ->where([ + 'bidding_user_type' => DemandTraits::$col[2], + 'bidding_user_id' => Admin::user()->id + ]) + ->exists(); + if ($demand_id && $isBidding) { + Admin::exit('你已经竞标过了,无需重复参加'); + } $form->disableEditingCheck(); $form->disableCreatingCheck(); $form->disableViewCheck(); diff --git a/app/AdminGuide/Controllers/DemandController.php b/app/AdminGuide/Controllers/DemandController.php index 02b38c5..085f1d4 100755 --- a/app/AdminGuide/Controllers/DemandController.php +++ b/app/AdminGuide/Controllers/DemandController.php @@ -80,7 +80,14 @@ class DemandController extends AdminController }else{ $grid->column('bidding','竞标') ->if(function (){ - return $this->state == 1 && $this->bidding_user_type == DemandTraits::$col[2]; + $isBidding = DemandBidding::query() + ->where('demand_id',$this->id) + ->where([ + 'bidding_user_type' => DemandTraits::$col[2], + 'bidding_user_id' => Admin::user()->id + ]) + ->doesntExist(); + return $this->state == 1 && $this->bidding_user_type == DemandTraits::$col[2] && $isBidding; }) ->then(function (Grid\Column $column) { $column->append('发起竞标'); @@ -90,6 +97,7 @@ class DemandController extends AdminController $grid->column('created_at')->sortable(); $grid->disableDeleteButton(); $grid->disableEditButton(); + $grid->disableCreateButton(); $grid->disableQuickEditButton(); $grid->disableViewButton(); $grid->disableRowSelector(); diff --git a/app/AdminSupplier/Controllers/DemandBiddingController.php b/app/AdminSupplier/Controllers/DemandBiddingController.php index 28e351c..9cf6245 100755 --- a/app/AdminSupplier/Controllers/DemandBiddingController.php +++ b/app/AdminSupplier/Controllers/DemandBiddingController.php @@ -110,7 +110,15 @@ class DemandBiddingController extends AdminController $form->disableViewCheck(); $demand_id = request('demand_id'); - if ($demand_id && \App\Models\DemandBidding::find($demand_id)) { + + $isBidding = \App\Models\DemandBidding::query() + ->where('demand_id',$demand_id) + ->where([ + 'bidding_user_type' => DemandTraits::$col[1], + 'bidding_user_id' => Admin::user()->id + ]) + ->exists(); + if ($demand_id && $isBidding) { Admin::exit('你已经竞标过了,无需重复参加'); } diff --git a/app/AdminSupplier/Controllers/DemandController.php b/app/AdminSupplier/Controllers/DemandController.php index 5b324b4..3d093b0 100755 --- a/app/AdminSupplier/Controllers/DemandController.php +++ b/app/AdminSupplier/Controllers/DemandController.php @@ -66,8 +66,15 @@ class DemandController extends AdminController }else{ $grid->column('bidding', '竞标') ->if(function () { - // $this->bidding 表示参加过竞标后不再显示 - return $this->state == 1 && $this->bidding_user_type == DemandTraits::$col[1] && $this->bidding; + // $isBidding 表示参加过竞标后不再显示 + $isBidding = DemandBidding::query() + ->where('demand_id',$this->id) + ->where([ + 'bidding_user_type' => DemandTraits::$col[1], + 'bidding_user_id' => Admin::user()->id + ]) + ->doesntExist(); + return $this->state == 1 && $this->bidding_user_type == DemandTraits::$col[1] && $isBidding; }) ->then(function (Grid\Column $column) { $column->append('发起竞标'); diff --git a/app/Common/StatementType.php b/app/Common/StatementType.php new file mode 100644 index 0000000..b6e6a93 --- /dev/null +++ b/app/Common/StatementType.php @@ -0,0 +1,25 @@ + '微信支付手续费', + self::CUT => '抽成', + self::ORDER => '订单结算', + ]; + } +} diff --git a/app/Http/Controllers/Api/OrderController.php b/app/Http/Controllers/Api/OrderController.php index 88b46b1..cc59007 100644 --- a/app/Http/Controllers/Api/OrderController.php +++ b/app/Http/Controllers/Api/OrderController.php @@ -191,6 +191,7 @@ class OrderController extends Controller 'pay_type' => $formData['pay_type'], 'coupon_id' => join(',', $coupon_ids), 'guide_id' => $ap->guide_id, + 'guide_price' => $ap->guide_price, 'timeout' => $timeout, 'agent_cloud_pid' => $ap->agent_cloud_pid, 'agent_cloud_price' => $ap->agentCloudProduct->price ?? 0, diff --git a/app/Http/Controllers/Api/VerificationController.php b/app/Http/Controllers/Api/VerificationController.php index 42ddf41..fbf2143 100644 --- a/app/Http/Controllers/Api/VerificationController.php +++ b/app/Http/Controllers/Api/VerificationController.php @@ -1,8 +1,11 @@ error('参数错误'); } list($id, $verify_code) = $code_arr; - $order = Order::with(['agentProduct:id,verifier','user','agent']) + $order = Order::with(['agentProduct:id,verifier', 'user', 'agent', 'guide']) ->where(['verify_code' => $verify_code]) ->whereIn('status', [OrderStatus::PAID, OrderStatus::PAID_RETAINAGE, OrderStatus::OFFLINE_PAID]) ->find($id); @@ -34,26 +39,198 @@ class VerificationController extends Controller return $this->error('订单不存在或订单状态不允许核销'); } - $mobile = User::where('id', $this->user_id)->value('mobile'); - - $checkMobile = Product::query()->whereIn('id', explode(',', $order->product_ids))->where('verify_mobile', $mobile)->doesntExist(); - if ($checkMobile) { - return $this->error('对不起,你没有核销权限,请联系管理员'); - } + //$mobile = User::where('id', $this->user_id)->value('mobile'); + // + //$checkMobile = Product::query()->whereIn('id', explode(',', $order->product_ids))->where('verify_mobile', $mobile)->doesntExist(); + //if ($checkMobile) { + // return $this->error('对不起,你没有核销权限,请联系管理员'); + //} $order->status = OrderStatus::SUCCESS; if ($order->save()) { - if(env('SMS_SWITCH','') == true) { + + //分账 + $this->fund($order); + //短信 + if (env('SMS_SWITCH', '') == true) { if (!empty($order->user->mobile)) { - (new SmsService)->send('verify', [$order->order_no,SmsTraits::$systeaNameText['user']], [$order->user->mobile]);//用户 + (new SmsService)->send('verify', [$order->order_no, SmsTraits::$systeaNameText['user']], [$order->user->mobile]);//用户 } - $supplierIds = OrderProductItem::query()->with('supplier')->where('order_id',$order->id)->distinct()->pluck('supplier_id'); - $phone = Supplier::query()->whereIn('id',$supplierIds)->pluck('contact_phone')->toArray(); - (new SmsService)->send('verify', [$order->order_no,SmsTraits::$systeaNameText['supplier']], $phone);//供应商 - (new SmsService)->send('verify', [$order->order_no,SmsTraits::$systeaNameText['agent']], [$order->agent->contact_phone]);//代理商 + $supplierIds = OrderProductItem::query()->with('supplier')->where('order_id', $order->id)->distinct()->pluck('supplier_id'); + $phone = Supplier::query()->whereIn('id', $supplierIds)->pluck('contact_phone')->toArray(); + (new SmsService)->send('verify', [$order->order_no, SmsTraits::$systeaNameText['supplier']], $phone);//供应商 + (new SmsService)->send('verify', [$order->order_no, SmsTraits::$systeaNameText['agent']], [$order->agent->contact_phone]);//代理商 } } return $this->success(); } + + public function fund($order) + { + DB::beginTransaction(); + try { + //最后批量插入 + $adminCreate = $statementCreate = []; + $cost = 0; + //如果有地接价格 分帐给地接 + if ($order->guide_price > 0) { + $guidePrice = $order->guide_price; + $cost = bcadd($cost, $order->guide_price, 6); + //成本价 加上地接价格 + $statementCreate[] = [ + 'price' => $order->guide_price, + 'type' => StatementType::ORDER, + 'user_id' => $order->guide->id, + 'user_type' => DemandTraits::$col[2], + 'order_id' => $order->id + ]; + //抽成 + if ($order->guide->rate > 0) { + //计算抽成金额 + $guideCut = bcmul($order->guide_price, $order->guide->rate, 6); + $cutPrice = $guideCut > 0 ? bcdiv($guideCut, 100, 6) : 0; + //总后台抽成流水 + if ($cutPrice > 0) { + $adminCreate[] = [ + 'price' => $cutPrice, + 'type' => StatementType::CUT, + 'cut_user_id' => $order->guide->id, + 'cut_user_type' => DemandTraits::$col[2], + 'order_id' => $order->id + ]; + //地接被抽成流水 + $statementCreate[] = [ + 'price' => bcmul($cutPrice, -1, 2), + 'type' => StatementType::CUT, + 'user_id' => $order->guide->id, + 'user_type' => DemandTraits::$col[2], + 'order_id' => $order->id + ]; + $guidePrice = bcsub($order->guide_price, $cutPrice, 6); + $guide = Guide::query()->where('id', $order->guide->id)->lockForUpdate()->first(); + $guide->balance = bcadd($guide->balance, $guidePrice, 6); + $guide->save(); + } + } + } + + //分账给供应商 + $orderItem = OrderProductItem::query() + ->where('order_id', $order->id) + ->with('supplier') + ->select('*') + ->selectRaw('sum(price) as sum_price') + ->groupBy('supplier_id') + ->get(); + foreach ($orderItem as $v) { + + $cost = bcadd($cost, $v->sum_price, 6); + $supplierPrice = $v->sum_price; + $statementCreate[] = [ + 'price' => $v->sum_price, + 'type' => StatementType::ORDER, + 'user_id' => $v->supplier_id, + 'user_type' => DemandTraits::$col[1], + 'order_id' => $order->id + ]; + + if ($v->supplier->rate > 0) { + //计算抽成金额 + $supplierCut = bcmul($v->sum_price, $v->supplier->rate, 6); + $cutPrice = $supplierCut > 0 ? bcdiv($supplierCut, 100, 6) : 0; + if ($cutPrice > 0) { + //总后台抽成流水 + $adminCreate[] = [ + 'price' => $cutPrice, + 'type' => StatementType::CUT, + 'cut_user_id' => $v->supplier_id, + 'cut_user_type' => DemandTraits::$col[1], + 'order_id' => $order->id + ]; + //供应商被抽成流水 + $statementCreate[] = [ + 'price' => bcmul($cutPrice, -1, 6), + 'type' => StatementType::CUT, + 'user_id' => $v->supplier_id, + 'user_type' => DemandTraits::$col[1], + 'order_id' => $order->id + ]; + $supplierPrice = bcsub($supplierPrice, $cutPrice, 6); + + } + } + $supplier = Supplier::query()->where('id', $v->supplier_id)->lockForUpdate()->first(); + $supplier->balance = bcadd($supplier->balance, $supplierPrice, 6); + $supplier->save(); + } + + //分账给代理商 + //成本价 加上地接价格 + $agentPrice = bcsub($order->price, $cost, 2); + + if ($agentPrice > 0) { + $statementCreate[] = [ + 'price' => $agentPrice, + 'type' => StatementType::ORDER, + 'user_id' => $order->agent_id, + 'user_type' => DemandTraits::$col[0], + 'order_id' => $order->id + ]; + + //抽成 + if ($order->agent->rate > 0) { + //计算抽成金额 + $agentCut = bcmul($agentPrice, $order->agent->rate, 6); + $cutPrice = $agentCut > 0 ? bcdiv($agentCut, 100, 6) : 0; + + //总后台抽成流水 + if ($cutPrice > 0) { + $adminCreate[] = [ + 'price' => $cutPrice, + 'type' => StatementType::CUT, + 'cut_user_id' => $order->agent->id, + 'cut_user_type' => DemandTraits::$col[0], + 'order_id' => $order->id + ]; + //代理商被抽成流水 + $statementCreate[] = [ + 'price' => bcmul($cutPrice, -1, 6), + 'type' => StatementType::CUT, + 'user_id' => $order->agent->id, + 'user_type' => DemandTraits::$col[0], + 'order_id' => $order->id + ]; + $agentPrice = bcsub($agentPrice, $cutPrice, 6); + } + } + + //扣除微信支付手续费 + $chargePrice = bcmul($order->price, 0.006, 6); + $statementCreate[] = [ + 'price' => bcmul($chargePrice, -1, 6), + 'type' => StatementType::CHARGE, + 'user_id' => $order->agent_id, + 'user_type' => DemandTraits::$col[0], + 'order_id' => $order->id + ]; + $agentPrice = bcsub($agentPrice, $chargePrice, 6); + $agent = Agent::query()->where('id', $order->agent->id)->lockForUpdate()->first(); + $agent->balance = bcadd($agent->balance, $agentPrice, 6); + $agent->save(); + } + //dd($adminCreate,$guideCreate); + if (!empty($adminCreate)) { + $order->statementAdmin()->createMany($adminCreate); + } + + if (!empty($statementCreate)) { + $order->statement()->createMany($statementCreate); + } + DB::commit(); + } catch (\Exception $e) { + DB::rollBack(); + return $this->error($e->getMessage()); + } + } } diff --git a/app/Models/Agent.php b/app/Models/Agent.php index 523ccc6..ab8a6ed 100644 --- a/app/Models/Agent.php +++ b/app/Models/Agent.php @@ -44,6 +44,7 @@ class Agent extends BaseModel return $this->morphOne('App\Models\DemandBidding', 'biddingUser'); } + public function workoorder() { return $this->morphOne('App\Models\Workorder', 'publisher'); @@ -53,4 +54,9 @@ class Agent extends BaseModel { return $this->morphOne('App\Models\WorkorderItem', 'publisher'); } + + public function statement() + { + return $this->morphMany('App\Models\Statement', 'user'); + } } diff --git a/app/Models/Guide.php b/app/Models/Guide.php index eae6bd9..bd41196 100644 --- a/app/Models/Guide.php +++ b/app/Models/Guide.php @@ -32,6 +32,7 @@ class Guide extends BaseModel return $this->morphOne('App\Models\DemandBidding', 'biddingUser'); } + public function workoorder() { return $this->morphOne('App\Models\Workorder', 'publisher'); @@ -41,4 +42,10 @@ class Guide extends BaseModel { return $this->morphOne('App\Models\WorkorderItem', 'publisher'); } + + public function statement() + { + return $this->morphMany('App\Models\Statement', 'user'); + + } } diff --git a/app/Models/Order.php b/app/Models/Order.php index c631c0a..3d7d56a 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -123,4 +123,14 @@ class Order extends BaseModel { return $this->belongsTo(AgentProduct::class, 'agent_cloud_pid', 'id'); } + + public function statementAdmin() + { + return $this->hasMany(StatementAdmin::class,'order_id','id'); + } + + public function statement() + { + return $this->hasMany(Statement::class,'order_id','id'); + } } diff --git a/app/Models/Statement.php b/app/Models/Statement.php new file mode 100755 index 0000000..ed1a060 --- /dev/null +++ b/app/Models/Statement.php @@ -0,0 +1,20 @@ +morphTo(); + } +} diff --git a/app/Models/StatementAdmin.php b/app/Models/StatementAdmin.php new file mode 100755 index 0000000..e8610cb --- /dev/null +++ b/app/Models/StatementAdmin.php @@ -0,0 +1,18 @@ +morphOne('App\Models\Workorder', 'point'); } + public function workoorderitem() { return $this->morphOne('App\Models\WorkorderItem', 'publisher'); } + + public function statement() + { + return $this->morphMany('App\Models\Statement', 'user'); + } } diff --git a/database/migrations/2021_09_10_165104_create_statement_admin_table.php b/database/migrations/2021_09_10_165104_create_statement_admin_table.php new file mode 100755 index 0000000..ed1be86 --- /dev/null +++ b/database/migrations/2021_09_10_165104_create_statement_admin_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->decimal('price')->default(0)->comment('金额'); + $table->tinyInteger('type')->default(0)->comment('类型 1 微信支付手续费 2 平台抽成 3 订单结算'); + $table->integer('cut_user_id')->default(0)->index()->comment('抽成用户id'); + $table->string('cut_user_type')->default('')->comment('抽成用户类型'); + $table->integer('order_id')->index()->default(0)->comment('订单id'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('statement_admin'); + } +} diff --git a/database/migrations/2021_09_10_175611_create_statement_agent_table.php b/database/migrations/2021_09_10_175611_create_statement_agent_table.php new file mode 100755 index 0000000..f77d0e6 --- /dev/null +++ b/database/migrations/2021_09_10_175611_create_statement_agent_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->decimal('price')->default(0)->comment('金额'); + $table->tinyInteger('type')->default(1)->comment('类型 1 微信支付手续费 2 平台抽成 3 订单结算'); + $table->integer('user_id')->index()->default(0)->comment('代理商id'); + $table->string('user_type')->default('')->comment('用户类型'); + $table->integer('order_id')->index()->default(0)->comment('订单id'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('statement_agent'); + } +} diff --git a/dcat_admin_ide_helper.php b/dcat_admin_ide_helper.php index 2fbaecd..04d33d9 100644 --- a/dcat_admin_ide_helper.php +++ b/dcat_admin_ide_helper.php @@ -11,258 +11,284 @@ namespace Dcat\Admin { use Illuminate\Support\Collection; /** + * @property Grid\Column|Collection created_at + * @property Grid\Column|Collection detail * @property Grid\Column|Collection id * @property Grid\Column|Collection name * @property Grid\Column|Collection type - * @property Grid\Column|Collection version - * @property Grid\Column|Collection detail - * @property Grid\Column|Collection created_at * @property Grid\Column|Collection updated_at + * @property Grid\Column|Collection version * @property Grid\Column|Collection is_enabled - * @property Grid\Column|Collection parent_id - * @property Grid\Column|Collection order + * @property Grid\Column|Collection extension * @property Grid\Column|Collection icon + * @property Grid\Column|Collection order + * @property Grid\Column|Collection parent_id * @property Grid\Column|Collection uri - * @property Grid\Column|Collection extension - * @property Grid\Column|Collection permission_id * @property Grid\Column|Collection menu_id - * @property Grid\Column|Collection slug + * @property Grid\Column|Collection permission_id * @property Grid\Column|Collection http_method * @property Grid\Column|Collection http_path + * @property Grid\Column|Collection slug * @property Grid\Column|Collection role_id * @property Grid\Column|Collection user_id * @property Grid\Column|Collection value - * @property Grid\Column|Collection username - * @property Grid\Column|Collection password * @property Grid\Column|Collection avatar + * @property Grid\Column|Collection password * @property Grid\Column|Collection remember_token + * @property Grid\Column|Collection username * @property Grid\Column|Collection agent_id + * @property Grid\Column|Collection display * @property Grid\Column|Collection picture - * @property Grid\Column|Collection status * @property Grid\Column|Collection sort + * @property Grid\Column|Collection status * @property Grid\Column|Collection url - * @property Grid\Column|Collection display * @property Grid\Column|Collection about - * @property Grid\Column|Collection reg_protocol * @property Grid\Column|Collection buy_protocol - * @property Grid\Column|Collection supplier_id + * @property Grid\Column|Collection reg_protocol * @property Grid\Column|Collection agent_product_id * @property Grid\Column|Collection product_id - * @property Grid\Column|Collection product_ids - * @property Grid\Column|Collection price - * @property Grid\Column|Collection original_price - * @property Grid\Column|Collection sale - * @property Grid\Column|Collection stock - * @property Grid\Column|Collection channel_id + * @property Grid\Column|Collection supplier_id + * @property Grid\Column|Collection agent_cloud_pid * @property Grid\Column|Collection category_id - * @property Grid\Column|Collection guide_id - * @property Grid\Column|Collection verifier - * @property Grid\Column|Collection is_rec - * @property Grid\Column|Collection pictures - * @property Grid\Column|Collection know + * @property Grid\Column|Collection channel_id * @property Grid\Column|Collection content + * @property Grid\Column|Collection deleted_at * @property Grid\Column|Collection deposit * @property Grid\Column|Collection deposit_timeout * @property Grid\Column|Collection earnest * @property Grid\Column|Collection earnest_timeout + * @property Grid\Column|Collection guide_id + * @property Grid\Column|Collection guide_price * @property Grid\Column|Collection is_cloud - * @property Grid\Column|Collection agent_cloud_pid - * @property Grid\Column|Collection deleted_at + * @property Grid\Column|Collection is_rec + * @property Grid\Column|Collection know + * @property Grid\Column|Collection original_price + * @property Grid\Column|Collection pictures + * @property Grid\Column|Collection price + * @property Grid\Column|Collection product_ids + * @property Grid\Column|Collection sale + * @property Grid\Column|Collection stock + * @property Grid\Column|Collection verifier * @property Grid\Column|Collection setting + * @property Grid\Column|Collection address * @property Grid\Column|Collection appid * @property Grid\Column|Collection appsecret - * @property Grid\Column|Collection mchid - * @property Grid\Column|Collection mchkey + * @property Grid\Column|Collection area_id + * @property Grid\Column|Collection balance + * @property Grid\Column|Collection city_id * @property Grid\Column|Collection company_name - * @property Grid\Column|Collection logo - * @property Grid\Column|Collection address - * @property Grid\Column|Collection license_pic - * @property Grid\Column|Collection director * @property Grid\Column|Collection contact_phone + * @property Grid\Column|Collection director + * @property Grid\Column|Collection license_pic + * @property Grid\Column|Collection logo + * @property Grid\Column|Collection mchid + * @property Grid\Column|Collection mchkey + * @property Grid\Column|Collection province_id * @property Grid\Column|Collection rate + * @property Grid\Column|Collection agent_product_ids * @property Grid\Column|Collection author * @property Grid\Column|Collection image - * @property Grid\Column|Collection agent_product_ids + * @property Grid\Column|Collection response * @property Grid\Column|Collection pid * @property Grid\Column|Collection template - * @property Grid\Column|Collection tag - * @property Grid\Column|Collection start_at * @property Grid\Column|Collection end_at + * @property Grid\Column|Collection start_at + * @property Grid\Column|Collection tag + * @property Grid\Column|Collection bidding_id + * @property Grid\Column|Collection bidding_user_id + * @property Grid\Column|Collection bidding_user_type * @property Grid\Column|Collection comment * @property Grid\Column|Collection deadline - * @property Grid\Column|Collection publisher_type + * @property Grid\Column|Collection demand_product_id + * @property Grid\Column|Collection images * @property Grid\Column|Collection publisher_id + * @property Grid\Column|Collection publisher_type * @property Grid\Column|Collection state - * @property Grid\Column|Collection bidding_user_type - * @property Grid\Column|Collection bidding_user_id - * @property Grid\Column|Collection bidding_id - * @property Grid\Column|Collection images - * @property Grid\Column|Collection demand_product_id * @property Grid\Column|Collection demand_id - * @property Grid\Column|Collection uuid * @property Grid\Column|Collection connection - * @property Grid\Column|Collection queue - * @property Grid\Column|Collection payload * @property Grid\Column|Collection exception * @property Grid\Column|Collection failed_at + * @property Grid\Column|Collection payload + * @property Grid\Column|Collection queue + * @property Grid\Column|Collection uuid * @property Grid\Column|Collection photo - * @property Grid\Column|Collection order_id * @property Grid\Column|Collection num - * @property Grid\Column|Collection order_no - * @property Grid\Column|Collection mobile - * @property Grid\Column|Collection pay_type + * @property Grid\Column|Collection order_id + * @property Grid\Column|Collection agent_cloud_price * @property Grid\Column|Collection coupon_id - * @property Grid\Column|Collection paid_money + * @property Grid\Column|Collection mobile + * @property Grid\Column|Collection order_no * @property Grid\Column|Collection paid_at + * @property Grid\Column|Collection paid_money + * @property Grid\Column|Collection pay_type + * @property Grid\Column|Collection pay_user_id * @property Grid\Column|Collection refund_info - * @property Grid\Column|Collection verify_code * @property Grid\Column|Collection timeout + * @property Grid\Column|Collection verify_code * @property Grid\Column|Collection email * @property Grid\Column|Collection token + * @property Grid\Column|Collection extends * @property Grid\Column|Collection verify_mobile + * @property Grid\Column|Collection cut_user_id + * @property Grid\Column|Collection cut_user_type + * @property Grid\Column|Collection publish_type * @property Grid\Column|Collection channels - * @property Grid\Column|Collection money * @property Grid\Column|Collection desc + * @property Grid\Column|Collection money + * @property Grid\Column|Collection out_trade_no * @property Grid\Column|Collection transaction_id - * @property Grid\Column|Collection nickname - * @property Grid\Column|Collection openid - * @property Grid\Column|Collection unionid - * @property Grid\Column|Collection is_verify - * @property Grid\Column|Collection country - * @property Grid\Column|Collection province * @property Grid\Column|Collection city + * @property Grid\Column|Collection country * @property Grid\Column|Collection gender + * @property Grid\Column|Collection is_verify * @property Grid\Column|Collection language - * @property Grid\Column|Collection point_type - * @property Grid\Column|Collection point_id + * @property Grid\Column|Collection nickname + * @property Grid\Column|Collection openid + * @property Grid\Column|Collection province + * @property Grid\Column|Collection unionid * @property Grid\Column|Collection close_time + * @property Grid\Column|Collection point_id + * @property Grid\Column|Collection point_type * @property Grid\Column|Collection workorder_id * + * @method Grid\Column|Collection created_at(string $label = null) + * @method Grid\Column|Collection detail(string $label = null) * @method Grid\Column|Collection id(string $label = null) * @method Grid\Column|Collection name(string $label = null) * @method Grid\Column|Collection type(string $label = null) - * @method Grid\Column|Collection version(string $label = null) - * @method Grid\Column|Collection detail(string $label = null) - * @method Grid\Column|Collection created_at(string $label = null) * @method Grid\Column|Collection updated_at(string $label = null) + * @method Grid\Column|Collection version(string $label = null) * @method Grid\Column|Collection is_enabled(string $label = null) - * @method Grid\Column|Collection parent_id(string $label = null) - * @method Grid\Column|Collection order(string $label = null) + * @method Grid\Column|Collection extension(string $label = null) * @method Grid\Column|Collection icon(string $label = null) + * @method Grid\Column|Collection order(string $label = null) + * @method Grid\Column|Collection parent_id(string $label = null) * @method Grid\Column|Collection uri(string $label = null) - * @method Grid\Column|Collection extension(string $label = null) - * @method Grid\Column|Collection permission_id(string $label = null) * @method Grid\Column|Collection menu_id(string $label = null) - * @method Grid\Column|Collection slug(string $label = null) + * @method Grid\Column|Collection permission_id(string $label = null) * @method Grid\Column|Collection http_method(string $label = null) * @method Grid\Column|Collection http_path(string $label = null) + * @method Grid\Column|Collection slug(string $label = null) * @method Grid\Column|Collection role_id(string $label = null) * @method Grid\Column|Collection user_id(string $label = null) * @method Grid\Column|Collection value(string $label = null) - * @method Grid\Column|Collection username(string $label = null) - * @method Grid\Column|Collection password(string $label = null) * @method Grid\Column|Collection avatar(string $label = null) + * @method Grid\Column|Collection password(string $label = null) * @method Grid\Column|Collection remember_token(string $label = null) + * @method Grid\Column|Collection username(string $label = null) * @method Grid\Column|Collection agent_id(string $label = null) + * @method Grid\Column|Collection display(string $label = null) * @method Grid\Column|Collection picture(string $label = null) - * @method Grid\Column|Collection status(string $label = null) * @method Grid\Column|Collection sort(string $label = null) + * @method Grid\Column|Collection status(string $label = null) * @method Grid\Column|Collection url(string $label = null) - * @method Grid\Column|Collection display(string $label = null) * @method Grid\Column|Collection about(string $label = null) - * @method Grid\Column|Collection reg_protocol(string $label = null) * @method Grid\Column|Collection buy_protocol(string $label = null) - * @method Grid\Column|Collection supplier_id(string $label = null) + * @method Grid\Column|Collection reg_protocol(string $label = null) * @method Grid\Column|Collection agent_product_id(string $label = null) * @method Grid\Column|Collection product_id(string $label = null) - * @method Grid\Column|Collection product_ids(string $label = null) - * @method Grid\Column|Collection price(string $label = null) - * @method Grid\Column|Collection original_price(string $label = null) - * @method Grid\Column|Collection sale(string $label = null) - * @method Grid\Column|Collection stock(string $label = null) - * @method Grid\Column|Collection channel_id(string $label = null) + * @method Grid\Column|Collection supplier_id(string $label = null) + * @method Grid\Column|Collection agent_cloud_pid(string $label = null) * @method Grid\Column|Collection category_id(string $label = null) - * @method Grid\Column|Collection guide_id(string $label = null) - * @method Grid\Column|Collection verifier(string $label = null) - * @method Grid\Column|Collection is_rec(string $label = null) - * @method Grid\Column|Collection pictures(string $label = null) - * @method Grid\Column|Collection know(string $label = null) + * @method Grid\Column|Collection channel_id(string $label = null) * @method Grid\Column|Collection content(string $label = null) + * @method Grid\Column|Collection deleted_at(string $label = null) * @method Grid\Column|Collection deposit(string $label = null) * @method Grid\Column|Collection deposit_timeout(string $label = null) * @method Grid\Column|Collection earnest(string $label = null) * @method Grid\Column|Collection earnest_timeout(string $label = null) + * @method Grid\Column|Collection guide_id(string $label = null) + * @method Grid\Column|Collection guide_price(string $label = null) * @method Grid\Column|Collection is_cloud(string $label = null) - * @method Grid\Column|Collection agent_cloud_pid(string $label = null) - * @method Grid\Column|Collection deleted_at(string $label = null) + * @method Grid\Column|Collection is_rec(string $label = null) + * @method Grid\Column|Collection know(string $label = null) + * @method Grid\Column|Collection original_price(string $label = null) + * @method Grid\Column|Collection pictures(string $label = null) + * @method Grid\Column|Collection price(string $label = null) + * @method Grid\Column|Collection product_ids(string $label = null) + * @method Grid\Column|Collection sale(string $label = null) + * @method Grid\Column|Collection stock(string $label = null) + * @method Grid\Column|Collection verifier(string $label = null) * @method Grid\Column|Collection setting(string $label = null) + * @method Grid\Column|Collection address(string $label = null) * @method Grid\Column|Collection appid(string $label = null) * @method Grid\Column|Collection appsecret(string $label = null) - * @method Grid\Column|Collection mchid(string $label = null) - * @method Grid\Column|Collection mchkey(string $label = null) + * @method Grid\Column|Collection area_id(string $label = null) + * @method Grid\Column|Collection balance(string $label = null) + * @method Grid\Column|Collection city_id(string $label = null) * @method Grid\Column|Collection company_name(string $label = null) - * @method Grid\Column|Collection logo(string $label = null) - * @method Grid\Column|Collection address(string $label = null) - * @method Grid\Column|Collection license_pic(string $label = null) - * @method Grid\Column|Collection director(string $label = null) * @method Grid\Column|Collection contact_phone(string $label = null) + * @method Grid\Column|Collection director(string $label = null) + * @method Grid\Column|Collection license_pic(string $label = null) + * @method Grid\Column|Collection logo(string $label = null) + * @method Grid\Column|Collection mchid(string $label = null) + * @method Grid\Column|Collection mchkey(string $label = null) + * @method Grid\Column|Collection province_id(string $label = null) * @method Grid\Column|Collection rate(string $label = null) + * @method Grid\Column|Collection agent_product_ids(string $label = null) * @method Grid\Column|Collection author(string $label = null) * @method Grid\Column|Collection image(string $label = null) - * @method Grid\Column|Collection agent_product_ids(string $label = null) + * @method Grid\Column|Collection response(string $label = null) * @method Grid\Column|Collection pid(string $label = null) * @method Grid\Column|Collection template(string $label = null) - * @method Grid\Column|Collection tag(string $label = null) - * @method Grid\Column|Collection start_at(string $label = null) * @method Grid\Column|Collection end_at(string $label = null) + * @method Grid\Column|Collection start_at(string $label = null) + * @method Grid\Column|Collection tag(string $label = null) + * @method Grid\Column|Collection bidding_id(string $label = null) + * @method Grid\Column|Collection bidding_user_id(string $label = null) + * @method Grid\Column|Collection bidding_user_type(string $label = null) * @method Grid\Column|Collection comment(string $label = null) * @method Grid\Column|Collection deadline(string $label = null) - * @method Grid\Column|Collection publisher_type(string $label = null) + * @method Grid\Column|Collection demand_product_id(string $label = null) + * @method Grid\Column|Collection images(string $label = null) * @method Grid\Column|Collection publisher_id(string $label = null) + * @method Grid\Column|Collection publisher_type(string $label = null) * @method Grid\Column|Collection state(string $label = null) - * @method Grid\Column|Collection bidding_user_type(string $label = null) - * @method Grid\Column|Collection bidding_user_id(string $label = null) - * @method Grid\Column|Collection bidding_id(string $label = null) - * @method Grid\Column|Collection images(string $label = null) - * @method Grid\Column|Collection demand_product_id(string $label = null) * @method Grid\Column|Collection demand_id(string $label = null) - * @method Grid\Column|Collection uuid(string $label = null) * @method Grid\Column|Collection connection(string $label = null) - * @method Grid\Column|Collection queue(string $label = null) - * @method Grid\Column|Collection payload(string $label = null) * @method Grid\Column|Collection exception(string $label = null) * @method Grid\Column|Collection failed_at(string $label = null) + * @method Grid\Column|Collection payload(string $label = null) + * @method Grid\Column|Collection queue(string $label = null) + * @method Grid\Column|Collection uuid(string $label = null) * @method Grid\Column|Collection photo(string $label = null) - * @method Grid\Column|Collection order_id(string $label = null) * @method Grid\Column|Collection num(string $label = null) - * @method Grid\Column|Collection order_no(string $label = null) - * @method Grid\Column|Collection mobile(string $label = null) - * @method Grid\Column|Collection pay_type(string $label = null) + * @method Grid\Column|Collection order_id(string $label = null) + * @method Grid\Column|Collection agent_cloud_price(string $label = null) * @method Grid\Column|Collection coupon_id(string $label = null) - * @method Grid\Column|Collection paid_money(string $label = null) + * @method Grid\Column|Collection mobile(string $label = null) + * @method Grid\Column|Collection order_no(string $label = null) * @method Grid\Column|Collection paid_at(string $label = null) + * @method Grid\Column|Collection paid_money(string $label = null) + * @method Grid\Column|Collection pay_type(string $label = null) + * @method Grid\Column|Collection pay_user_id(string $label = null) * @method Grid\Column|Collection refund_info(string $label = null) - * @method Grid\Column|Collection verify_code(string $label = null) * @method Grid\Column|Collection timeout(string $label = null) + * @method Grid\Column|Collection verify_code(string $label = null) * @method Grid\Column|Collection email(string $label = null) * @method Grid\Column|Collection token(string $label = null) + * @method Grid\Column|Collection extends(string $label = null) * @method Grid\Column|Collection verify_mobile(string $label = null) + * @method Grid\Column|Collection cut_user_id(string $label = null) + * @method Grid\Column|Collection cut_user_type(string $label = null) + * @method Grid\Column|Collection publish_type(string $label = null) * @method Grid\Column|Collection channels(string $label = null) - * @method Grid\Column|Collection money(string $label = null) * @method Grid\Column|Collection desc(string $label = null) + * @method Grid\Column|Collection money(string $label = null) + * @method Grid\Column|Collection out_trade_no(string $label = null) * @method Grid\Column|Collection transaction_id(string $label = null) - * @method Grid\Column|Collection nickname(string $label = null) - * @method Grid\Column|Collection openid(string $label = null) - * @method Grid\Column|Collection unionid(string $label = null) - * @method Grid\Column|Collection is_verify(string $label = null) - * @method Grid\Column|Collection country(string $label = null) - * @method Grid\Column|Collection province(string $label = null) * @method Grid\Column|Collection city(string $label = null) + * @method Grid\Column|Collection country(string $label = null) * @method Grid\Column|Collection gender(string $label = null) + * @method Grid\Column|Collection is_verify(string $label = null) * @method Grid\Column|Collection language(string $label = null) - * @method Grid\Column|Collection point_type(string $label = null) - * @method Grid\Column|Collection point_id(string $label = null) + * @method Grid\Column|Collection nickname(string $label = null) + * @method Grid\Column|Collection openid(string $label = null) + * @method Grid\Column|Collection province(string $label = null) + * @method Grid\Column|Collection unionid(string $label = null) * @method Grid\Column|Collection close_time(string $label = null) + * @method Grid\Column|Collection point_id(string $label = null) + * @method Grid\Column|Collection point_type(string $label = null) * @method Grid\Column|Collection workorder_id(string $label = null) */ class Grid {} @@ -270,264 +296,290 @@ namespace Dcat\Admin { class MiniGrid extends Grid {} /** + * @property Show\Field|Collection created_at + * @property Show\Field|Collection detail * @property Show\Field|Collection id * @property Show\Field|Collection name * @property Show\Field|Collection type - * @property Show\Field|Collection version - * @property Show\Field|Collection detail - * @property Show\Field|Collection created_at * @property Show\Field|Collection updated_at + * @property Show\Field|Collection version * @property Show\Field|Collection is_enabled - * @property Show\Field|Collection parent_id - * @property Show\Field|Collection order + * @property Show\Field|Collection extension * @property Show\Field|Collection icon + * @property Show\Field|Collection order + * @property Show\Field|Collection parent_id * @property Show\Field|Collection uri - * @property Show\Field|Collection extension - * @property Show\Field|Collection permission_id * @property Show\Field|Collection menu_id - * @property Show\Field|Collection slug + * @property Show\Field|Collection permission_id * @property Show\Field|Collection http_method * @property Show\Field|Collection http_path + * @property Show\Field|Collection slug * @property Show\Field|Collection role_id * @property Show\Field|Collection user_id * @property Show\Field|Collection value - * @property Show\Field|Collection username - * @property Show\Field|Collection password * @property Show\Field|Collection avatar + * @property Show\Field|Collection password * @property Show\Field|Collection remember_token + * @property Show\Field|Collection username * @property Show\Field|Collection agent_id + * @property Show\Field|Collection display * @property Show\Field|Collection picture - * @property Show\Field|Collection status * @property Show\Field|Collection sort + * @property Show\Field|Collection status * @property Show\Field|Collection url - * @property Show\Field|Collection display * @property Show\Field|Collection about - * @property Show\Field|Collection reg_protocol * @property Show\Field|Collection buy_protocol - * @property Show\Field|Collection supplier_id + * @property Show\Field|Collection reg_protocol * @property Show\Field|Collection agent_product_id * @property Show\Field|Collection product_id - * @property Show\Field|Collection product_ids - * @property Show\Field|Collection price - * @property Show\Field|Collection original_price - * @property Show\Field|Collection sale - * @property Show\Field|Collection stock - * @property Show\Field|Collection channel_id + * @property Show\Field|Collection supplier_id + * @property Show\Field|Collection agent_cloud_pid * @property Show\Field|Collection category_id - * @property Show\Field|Collection guide_id - * @property Show\Field|Collection verifier - * @property Show\Field|Collection is_rec - * @property Show\Field|Collection pictures - * @property Show\Field|Collection know + * @property Show\Field|Collection channel_id * @property Show\Field|Collection content + * @property Show\Field|Collection deleted_at * @property Show\Field|Collection deposit * @property Show\Field|Collection deposit_timeout * @property Show\Field|Collection earnest * @property Show\Field|Collection earnest_timeout + * @property Show\Field|Collection guide_id + * @property Show\Field|Collection guide_price * @property Show\Field|Collection is_cloud - * @property Show\Field|Collection agent_cloud_pid - * @property Show\Field|Collection deleted_at + * @property Show\Field|Collection is_rec + * @property Show\Field|Collection know + * @property Show\Field|Collection original_price + * @property Show\Field|Collection pictures + * @property Show\Field|Collection price + * @property Show\Field|Collection product_ids + * @property Show\Field|Collection sale + * @property Show\Field|Collection stock + * @property Show\Field|Collection verifier * @property Show\Field|Collection setting + * @property Show\Field|Collection address * @property Show\Field|Collection appid * @property Show\Field|Collection appsecret - * @property Show\Field|Collection mchid - * @property Show\Field|Collection mchkey + * @property Show\Field|Collection area_id + * @property Show\Field|Collection balance + * @property Show\Field|Collection city_id * @property Show\Field|Collection company_name - * @property Show\Field|Collection logo - * @property Show\Field|Collection address - * @property Show\Field|Collection license_pic - * @property Show\Field|Collection director * @property Show\Field|Collection contact_phone + * @property Show\Field|Collection director + * @property Show\Field|Collection license_pic + * @property Show\Field|Collection logo + * @property Show\Field|Collection mchid + * @property Show\Field|Collection mchkey + * @property Show\Field|Collection province_id * @property Show\Field|Collection rate + * @property Show\Field|Collection agent_product_ids * @property Show\Field|Collection author * @property Show\Field|Collection image - * @property Show\Field|Collection agent_product_ids + * @property Show\Field|Collection response * @property Show\Field|Collection pid * @property Show\Field|Collection template - * @property Show\Field|Collection tag - * @property Show\Field|Collection start_at * @property Show\Field|Collection end_at + * @property Show\Field|Collection start_at + * @property Show\Field|Collection tag + * @property Show\Field|Collection bidding_id + * @property Show\Field|Collection bidding_user_id + * @property Show\Field|Collection bidding_user_type * @property Show\Field|Collection comment * @property Show\Field|Collection deadline - * @property Show\Field|Collection publisher_type + * @property Show\Field|Collection demand_product_id + * @property Show\Field|Collection images * @property Show\Field|Collection publisher_id + * @property Show\Field|Collection publisher_type * @property Show\Field|Collection state - * @property Show\Field|Collection bidding_user_type - * @property Show\Field|Collection bidding_user_id - * @property Show\Field|Collection bidding_id - * @property Show\Field|Collection images - * @property Show\Field|Collection demand_product_id * @property Show\Field|Collection demand_id - * @property Show\Field|Collection uuid * @property Show\Field|Collection connection - * @property Show\Field|Collection queue - * @property Show\Field|Collection payload * @property Show\Field|Collection exception * @property Show\Field|Collection failed_at + * @property Show\Field|Collection payload + * @property Show\Field|Collection queue + * @property Show\Field|Collection uuid * @property Show\Field|Collection photo - * @property Show\Field|Collection order_id * @property Show\Field|Collection num - * @property Show\Field|Collection order_no - * @property Show\Field|Collection mobile - * @property Show\Field|Collection pay_type + * @property Show\Field|Collection order_id + * @property Show\Field|Collection agent_cloud_price * @property Show\Field|Collection coupon_id - * @property Show\Field|Collection paid_money + * @property Show\Field|Collection mobile + * @property Show\Field|Collection order_no * @property Show\Field|Collection paid_at + * @property Show\Field|Collection paid_money + * @property Show\Field|Collection pay_type + * @property Show\Field|Collection pay_user_id * @property Show\Field|Collection refund_info - * @property Show\Field|Collection verify_code * @property Show\Field|Collection timeout + * @property Show\Field|Collection verify_code * @property Show\Field|Collection email * @property Show\Field|Collection token + * @property Show\Field|Collection extends * @property Show\Field|Collection verify_mobile + * @property Show\Field|Collection cut_user_id + * @property Show\Field|Collection cut_user_type + * @property Show\Field|Collection publish_type * @property Show\Field|Collection channels - * @property Show\Field|Collection money * @property Show\Field|Collection desc + * @property Show\Field|Collection money + * @property Show\Field|Collection out_trade_no * @property Show\Field|Collection transaction_id - * @property Show\Field|Collection nickname - * @property Show\Field|Collection openid - * @property Show\Field|Collection unionid - * @property Show\Field|Collection is_verify - * @property Show\Field|Collection country - * @property Show\Field|Collection province * @property Show\Field|Collection city + * @property Show\Field|Collection country * @property Show\Field|Collection gender + * @property Show\Field|Collection is_verify * @property Show\Field|Collection language - * @property Show\Field|Collection point_type - * @property Show\Field|Collection point_id + * @property Show\Field|Collection nickname + * @property Show\Field|Collection openid + * @property Show\Field|Collection province + * @property Show\Field|Collection unionid * @property Show\Field|Collection close_time + * @property Show\Field|Collection point_id + * @property Show\Field|Collection point_type * @property Show\Field|Collection workorder_id * + * @method Show\Field|Collection created_at(string $label = null) + * @method Show\Field|Collection detail(string $label = null) * @method Show\Field|Collection id(string $label = null) * @method Show\Field|Collection name(string $label = null) * @method Show\Field|Collection type(string $label = null) - * @method Show\Field|Collection version(string $label = null) - * @method Show\Field|Collection detail(string $label = null) - * @method Show\Field|Collection created_at(string $label = null) * @method Show\Field|Collection updated_at(string $label = null) + * @method Show\Field|Collection version(string $label = null) * @method Show\Field|Collection is_enabled(string $label = null) - * @method Show\Field|Collection parent_id(string $label = null) - * @method Show\Field|Collection order(string $label = null) + * @method Show\Field|Collection extension(string $label = null) * @method Show\Field|Collection icon(string $label = null) + * @method Show\Field|Collection order(string $label = null) + * @method Show\Field|Collection parent_id(string $label = null) * @method Show\Field|Collection uri(string $label = null) - * @method Show\Field|Collection extension(string $label = null) - * @method Show\Field|Collection permission_id(string $label = null) * @method Show\Field|Collection menu_id(string $label = null) - * @method Show\Field|Collection slug(string $label = null) + * @method Show\Field|Collection permission_id(string $label = null) * @method Show\Field|Collection http_method(string $label = null) * @method Show\Field|Collection http_path(string $label = null) + * @method Show\Field|Collection slug(string $label = null) * @method Show\Field|Collection role_id(string $label = null) * @method Show\Field|Collection user_id(string $label = null) * @method Show\Field|Collection value(string $label = null) - * @method Show\Field|Collection username(string $label = null) - * @method Show\Field|Collection password(string $label = null) * @method Show\Field|Collection avatar(string $label = null) + * @method Show\Field|Collection password(string $label = null) * @method Show\Field|Collection remember_token(string $label = null) + * @method Show\Field|Collection username(string $label = null) * @method Show\Field|Collection agent_id(string $label = null) + * @method Show\Field|Collection display(string $label = null) * @method Show\Field|Collection picture(string $label = null) - * @method Show\Field|Collection status(string $label = null) * @method Show\Field|Collection sort(string $label = null) + * @method Show\Field|Collection status(string $label = null) * @method Show\Field|Collection url(string $label = null) - * @method Show\Field|Collection display(string $label = null) * @method Show\Field|Collection about(string $label = null) - * @method Show\Field|Collection reg_protocol(string $label = null) * @method Show\Field|Collection buy_protocol(string $label = null) - * @method Show\Field|Collection supplier_id(string $label = null) + * @method Show\Field|Collection reg_protocol(string $label = null) * @method Show\Field|Collection agent_product_id(string $label = null) * @method Show\Field|Collection product_id(string $label = null) - * @method Show\Field|Collection product_ids(string $label = null) - * @method Show\Field|Collection price(string $label = null) - * @method Show\Field|Collection original_price(string $label = null) - * @method Show\Field|Collection sale(string $label = null) - * @method Show\Field|Collection stock(string $label = null) - * @method Show\Field|Collection channel_id(string $label = null) + * @method Show\Field|Collection supplier_id(string $label = null) + * @method Show\Field|Collection agent_cloud_pid(string $label = null) * @method Show\Field|Collection category_id(string $label = null) - * @method Show\Field|Collection guide_id(string $label = null) - * @method Show\Field|Collection verifier(string $label = null) - * @method Show\Field|Collection is_rec(string $label = null) - * @method Show\Field|Collection pictures(string $label = null) - * @method Show\Field|Collection know(string $label = null) + * @method Show\Field|Collection channel_id(string $label = null) * @method Show\Field|Collection content(string $label = null) + * @method Show\Field|Collection deleted_at(string $label = null) * @method Show\Field|Collection deposit(string $label = null) * @method Show\Field|Collection deposit_timeout(string $label = null) * @method Show\Field|Collection earnest(string $label = null) * @method Show\Field|Collection earnest_timeout(string $label = null) + * @method Show\Field|Collection guide_id(string $label = null) + * @method Show\Field|Collection guide_price(string $label = null) * @method Show\Field|Collection is_cloud(string $label = null) - * @method Show\Field|Collection agent_cloud_pid(string $label = null) - * @method Show\Field|Collection deleted_at(string $label = null) + * @method Show\Field|Collection is_rec(string $label = null) + * @method Show\Field|Collection know(string $label = null) + * @method Show\Field|Collection original_price(string $label = null) + * @method Show\Field|Collection pictures(string $label = null) + * @method Show\Field|Collection price(string $label = null) + * @method Show\Field|Collection product_ids(string $label = null) + * @method Show\Field|Collection sale(string $label = null) + * @method Show\Field|Collection stock(string $label = null) + * @method Show\Field|Collection verifier(string $label = null) * @method Show\Field|Collection setting(string $label = null) + * @method Show\Field|Collection address(string $label = null) * @method Show\Field|Collection appid(string $label = null) * @method Show\Field|Collection appsecret(string $label = null) - * @method Show\Field|Collection mchid(string $label = null) - * @method Show\Field|Collection mchkey(string $label = null) + * @method Show\Field|Collection area_id(string $label = null) + * @method Show\Field|Collection balance(string $label = null) + * @method Show\Field|Collection city_id(string $label = null) * @method Show\Field|Collection company_name(string $label = null) - * @method Show\Field|Collection logo(string $label = null) - * @method Show\Field|Collection address(string $label = null) - * @method Show\Field|Collection license_pic(string $label = null) - * @method Show\Field|Collection director(string $label = null) * @method Show\Field|Collection contact_phone(string $label = null) + * @method Show\Field|Collection director(string $label = null) + * @method Show\Field|Collection license_pic(string $label = null) + * @method Show\Field|Collection logo(string $label = null) + * @method Show\Field|Collection mchid(string $label = null) + * @method Show\Field|Collection mchkey(string $label = null) + * @method Show\Field|Collection province_id(string $label = null) * @method Show\Field|Collection rate(string $label = null) + * @method Show\Field|Collection agent_product_ids(string $label = null) * @method Show\Field|Collection author(string $label = null) * @method Show\Field|Collection image(string $label = null) - * @method Show\Field|Collection agent_product_ids(string $label = null) + * @method Show\Field|Collection response(string $label = null) * @method Show\Field|Collection pid(string $label = null) * @method Show\Field|Collection template(string $label = null) - * @method Show\Field|Collection tag(string $label = null) - * @method Show\Field|Collection start_at(string $label = null) * @method Show\Field|Collection end_at(string $label = null) + * @method Show\Field|Collection start_at(string $label = null) + * @method Show\Field|Collection tag(string $label = null) + * @method Show\Field|Collection bidding_id(string $label = null) + * @method Show\Field|Collection bidding_user_id(string $label = null) + * @method Show\Field|Collection bidding_user_type(string $label = null) * @method Show\Field|Collection comment(string $label = null) * @method Show\Field|Collection deadline(string $label = null) - * @method Show\Field|Collection publisher_type(string $label = null) + * @method Show\Field|Collection demand_product_id(string $label = null) + * @method Show\Field|Collection images(string $label = null) * @method Show\Field|Collection publisher_id(string $label = null) + * @method Show\Field|Collection publisher_type(string $label = null) * @method Show\Field|Collection state(string $label = null) - * @method Show\Field|Collection bidding_user_type(string $label = null) - * @method Show\Field|Collection bidding_user_id(string $label = null) - * @method Show\Field|Collection bidding_id(string $label = null) - * @method Show\Field|Collection images(string $label = null) - * @method Show\Field|Collection demand_product_id(string $label = null) * @method Show\Field|Collection demand_id(string $label = null) - * @method Show\Field|Collection uuid(string $label = null) * @method Show\Field|Collection connection(string $label = null) - * @method Show\Field|Collection queue(string $label = null) - * @method Show\Field|Collection payload(string $label = null) * @method Show\Field|Collection exception(string $label = null) * @method Show\Field|Collection failed_at(string $label = null) + * @method Show\Field|Collection payload(string $label = null) + * @method Show\Field|Collection queue(string $label = null) + * @method Show\Field|Collection uuid(string $label = null) * @method Show\Field|Collection photo(string $label = null) - * @method Show\Field|Collection order_id(string $label = null) * @method Show\Field|Collection num(string $label = null) - * @method Show\Field|Collection order_no(string $label = null) - * @method Show\Field|Collection mobile(string $label = null) - * @method Show\Field|Collection pay_type(string $label = null) + * @method Show\Field|Collection order_id(string $label = null) + * @method Show\Field|Collection agent_cloud_price(string $label = null) * @method Show\Field|Collection coupon_id(string $label = null) - * @method Show\Field|Collection paid_money(string $label = null) + * @method Show\Field|Collection mobile(string $label = null) + * @method Show\Field|Collection order_no(string $label = null) * @method Show\Field|Collection paid_at(string $label = null) + * @method Show\Field|Collection paid_money(string $label = null) + * @method Show\Field|Collection pay_type(string $label = null) + * @method Show\Field|Collection pay_user_id(string $label = null) * @method Show\Field|Collection refund_info(string $label = null) - * @method Show\Field|Collection verify_code(string $label = null) * @method Show\Field|Collection timeout(string $label = null) + * @method Show\Field|Collection verify_code(string $label = null) * @method Show\Field|Collection email(string $label = null) * @method Show\Field|Collection token(string $label = null) + * @method Show\Field|Collection extends(string $label = null) * @method Show\Field|Collection verify_mobile(string $label = null) + * @method Show\Field|Collection cut_user_id(string $label = null) + * @method Show\Field|Collection cut_user_type(string $label = null) + * @method Show\Field|Collection publish_type(string $label = null) * @method Show\Field|Collection channels(string $label = null) - * @method Show\Field|Collection money(string $label = null) * @method Show\Field|Collection desc(string $label = null) + * @method Show\Field|Collection money(string $label = null) + * @method Show\Field|Collection out_trade_no(string $label = null) * @method Show\Field|Collection transaction_id(string $label = null) - * @method Show\Field|Collection nickname(string $label = null) - * @method Show\Field|Collection openid(string $label = null) - * @method Show\Field|Collection unionid(string $label = null) - * @method Show\Field|Collection is_verify(string $label = null) - * @method Show\Field|Collection country(string $label = null) - * @method Show\Field|Collection province(string $label = null) * @method Show\Field|Collection city(string $label = null) + * @method Show\Field|Collection country(string $label = null) * @method Show\Field|Collection gender(string $label = null) + * @method Show\Field|Collection is_verify(string $label = null) * @method Show\Field|Collection language(string $label = null) - * @method Show\Field|Collection point_type(string $label = null) - * @method Show\Field|Collection point_id(string $label = null) + * @method Show\Field|Collection nickname(string $label = null) + * @method Show\Field|Collection openid(string $label = null) + * @method Show\Field|Collection province(string $label = null) + * @method Show\Field|Collection unionid(string $label = null) * @method Show\Field|Collection close_time(string $label = null) + * @method Show\Field|Collection point_id(string $label = null) + * @method Show\Field|Collection point_type(string $label = null) * @method Show\Field|Collection workorder_id(string $label = null) */ class Show {} /** - + * @method \SuperEggs\DcatDistpicker\Form\Distpicker distpicker(...$params) */ class Form {} @@ -540,7 +592,7 @@ namespace Dcat\Admin\Grid { class Column {} /** - + * @method \SuperEggs\DcatDistpicker\Filter\DistpickerFilter distpicker(...$params) */ class Filter {} } From ee3cad1a199c4c46062514a1024d8c772a9c4343 Mon Sep 17 00:00:00 2001 From: lemon <15040771@qq.com> Date: Sat, 11 Sep 2021 16:22:05 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminAgent/Controllers/DemandBiddingController.php | 2 +- app/AdminGuide/Controllers/DemandBiddingController.php | 2 +- app/AdminSupplier/Controllers/DemandBiddingController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/AdminAgent/Controllers/DemandBiddingController.php b/app/AdminAgent/Controllers/DemandBiddingController.php index c90238c..078a73d 100755 --- a/app/AdminAgent/Controllers/DemandBiddingController.php +++ b/app/AdminAgent/Controllers/DemandBiddingController.php @@ -109,7 +109,7 @@ class DemandBiddingController extends AdminController $provinceId = Demand::query()->where('id',$this->demand_id)->value('province_id'); if ($provinceId != Admin::user()->province_id) { - $form->response()->error('竞标失败,指能竞标跟自己相同省份的的需求'); + $form->response()->error('竞标失败,只能竞标跟自己相同省份的的需求'); } // 判断是否是新增操作 if ($form->isCreating()) { diff --git a/app/AdminGuide/Controllers/DemandBiddingController.php b/app/AdminGuide/Controllers/DemandBiddingController.php index 8331821..2b9cad1 100755 --- a/app/AdminGuide/Controllers/DemandBiddingController.php +++ b/app/AdminGuide/Controllers/DemandBiddingController.php @@ -109,7 +109,7 @@ class DemandBiddingController extends AdminController $provinceId = Demand::query()->where('id',$this->demand_id)->value('province_id'); if ($provinceId != Admin::user()->province_id) { - $form->response()->error('竞标失败,指能竞标跟自己相同省份的的需求'); + $form->response()->error('竞标失败,只能竞标跟自己相同省份的的需求'); } // 判断是否是新增操作 if ($form->isCreating()) { diff --git a/app/AdminSupplier/Controllers/DemandBiddingController.php b/app/AdminSupplier/Controllers/DemandBiddingController.php index 9cf6245..151d8e2 100755 --- a/app/AdminSupplier/Controllers/DemandBiddingController.php +++ b/app/AdminSupplier/Controllers/DemandBiddingController.php @@ -149,7 +149,7 @@ class DemandBiddingController extends AdminController $provinceId = Demand::query()->where('id',$this->demand_id)->value('province_id'); if ($provinceId != Admin::user()->province_id) { - $form->response()->error('竞标失败,指能竞标跟自己相同省份的的需求'); + $form->response()->error('竞标失败,只能竞标跟自己相同省份的的需求'); } if($form->isEditing()) { $productId = request('demand_product_id', 0);