Commit 172ca9a1 by yink

历史提交

parent 7e1daeaf
......@@ -17,3 +17,4 @@ yarn-error.log
/.fleet
/.idea
/.vscode
*.log
\ No newline at end of file
<?php
namespace App\Admin\Actions;
use Dcat\Admin\Actions\Response;
use App\Admin\Forms\EditShareUserForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Traits\HasPermissions;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Http\Request;
use Dcat\Admin\Widgets\Modal;
class EditShareUserAct extends RowAction
{
protected $uid = 0;
/**
* 接收参数
*/
public function __construct($title = '', $uid = 0)
{
$this->uid = $uid;
parent::__construct($title);
$this->title = $title;
}
/**
* @return string
*/
//protected $title = '<i class="feather icon-stop-circle"> </i>';
/**
* 按钮文本
*
* @return string|void
*/
public function title()
{
return '<i class="feather icon-edit-1"></i> ' . $this->title . '';
}
/**
* Handle the action request.
*
* @param Request $request
*
* @return Response
*/
public function handle(Request $request)
{
$id = $this->getKey() ?? 0;
return $this->response()->success('成功')->refresh();
}
/**
* 渲染模态框.
* @return Modal
*/
public function render()
{
// 这里直接创建一个modal框 model的内容由工具表单提供,这里也需要创建一个工具表单才行
return Modal::make()
->lg()
->title($this->title)
->button($this->title())
->body(EditShareUserForm::make()->payload(['uid' => $this->uid]));
//->button("<button class='btn btn-sm btn-primary'>$this->title</button>"); // 这个button就是对应上面的按钮
}
/**
* @return string|array|void
*/
public function confirm()
{
// return ['Confirm?', 'contents'];
}
/**
* @param Model|Authenticatable|HasPermissions|null $user
*
* @return bool
*/
protected function authorize($user): bool
{
return true;
}
/**
* @return array
*/
protected function parameters()
{
return [];
}
}
<?php
namespace App\Admin\Actions;
use Dcat\Admin\Actions\Response;
use App\Admin\Forms\TransferBillsPlatForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Traits\HasPermissions;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Http\Request;
use Dcat\Admin\Widgets\Modal;
class TransferToPlatForm extends RowAction
{
protected $id = 0;
/**
* 接收参数
*/
public function __construct($title = '', $id = 0)
{
$this->id = $id;
parent::__construct($title);
$this->title = $title;
}
/**
* 按钮文本
*
* @return string|void
*/
public function title()
{
return '<i class="feather icon-edit"></i> ' . $this->title;
}
/**
* Handle the action request.
*
* @param Request $request
*
* @return Response
*/
public function handle(Request $request)
{
$id = $this->getKey() ?? 0;
return $this->response()->success('成功')->refresh();
}
/**
* 渲染模态框.
* @return Modal
*/
public function render()
{
// 这里直接创建一个modal框 model的内容由工具表单提供,这里也需要创建一个工具表单才行
return Modal::make()
->lg()
->title($this->title)
->button($this->title())
->body(TransferBillsPlatForm::make()->payload(['id' => $this->id]));
}
/**
* @return string|array|void
*/
public function confirm()
{
//return ['Confirm?', 'contents'];
}
/**
* @param Model|Authenticatable|HasPermissions|null $user
*
* @return bool
*/
protected function authorize($user): bool
{
return true;
}
/**
* @return array
*/
protected function parameters()
{
return [];
}
}
......@@ -25,7 +25,7 @@ class UserBuyCode extends RowAction
*/
public function title()
{
return '<i class="feather icon-stop-circle"></i> ' . $this->title . '';
return '<i class="feather icon-edit"></i> ' . '直购码';
}
/**
* Handle the action request.
......@@ -55,7 +55,7 @@ public function render()
return Modal::make()
->lg()
->title('直购码')
->button("直购码")
->button($this->title())
->body(BuyCodeForm::make())
->onShown(
<<<js
......
<?php
namespace App\Admin\Controllers;
use App\Models\Category;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Layout\Row;
use Dcat\Admin\Tree;
use Dcat\Admin\Http\Controllers\AdminController;
use NwVVVS\AdapaySdk\AdapayTools;
class CategoryControllerTest extends AdminController
{
public function index(Content $content)
{
return $content->header('对账单下载')
->description('csv')
->body(function (Row $row) {
// 移除表单创建逻辑
// 这里可以添加你想要展示的内容,例如文本信息
//$row->column(12, '<p>这是对账单下载页面,请选择合适的操作。</p>');
// 添加时间选择控件和按钮
$row->column(12, '<input type="date" id="download-date" />');
$row->column(12, '<button id="download-button">下载</button>');
// 添加 JavaScript 代码绑定点击事件
$row->column(
12,
<<<HTML
<script>
document.getElementById('download-button').addEventListener('click', function() {
var date = document.getElementById('download-date').value;
if (date) {
fetch('/category-download?date=' + date, {
method: 'GET'
})
.then(response => response.json())
.then(data => {
console.log(data);
// 这里可以添加更多处理逻辑,例如显示提示信息
});
} else {
alert('请选择日期');
}
});
</script>
HTML
);
});
}
/**
* 处理下载请求
*/
public function download()
{
$date = request()->input('date');
# 初始化对账单下载对象类
$bill = new AdapayTools;
# 对账单日期
# 对账单下载
$bill->download(["bill_date" => "20250303"]);
# 对账单下载结果进行处理
if ($bill->isError()) {
//失败处理
//var_dump($bill->result);
} else {
//成功处理
//var_dump($bill->result);
}
return response()->json(['message' => '下载请求已接收', 'date' => $bill]);
}
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new Category(), function (Grid $grid) {
$grid->column('id')->sortable();
$grid->column('parent_id');
$grid->column('title');
$grid->column('icon');
$grid->column('order');
$grid->column('show');
$grid->column('created_at');
$grid->column('updated_at')->sortable();
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('id');
});
// 隐藏列表操作按钮
$grid->disableActions();
// 隐藏列表顶部的按钮
$grid->disableCreateButton();
$grid->disableBatchDelete();
$grid->disableExport();
$grid->disableFilterButton();
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new Category(), function (Show $show) {
$show->field('id');
$show->field('parent_id');
$show->field('title');
$show->field('icon');
$show->field('order');
$show->field('show');
$show->field('created_at');
$show->field('updated_at');
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new Category(), function (Form $form) {
$form->display('id');
$form->select('parent_id')
->options(Category::selectOptions())
->saving(function ($v) {
return $v ?? 0;
});
$form->text('title');
// $form->image('icon', '分类图标')
// ->accept('jpg,jpeg,png')
// ->maxSize(4096)
// ->url('upload/category')
// ->help('仅支持jpg、jpeg、png格式图片上传(750px * 420px)')
// ->autoUpload();
$form->text('order')->help('越小越靠前');
$form->switch('show', '状态')->default(1);
// $form->display('created_at');
// $form->display('updated_at');
// 隐藏表单底部的按钮
$form->disableResetButton();
$form->disableViewCheck();
$form->disableEditingCheck();
$form->disableCreatingCheck();
// 如果你想隐藏提交按钮,可以使用以下代码
// $form->disableSubmit();
});
}
}
......@@ -64,6 +64,9 @@ protected function grid()
$grid->column('is_hot', '是否推荐')->display(function ($val) {
return ($val == 1) ? '是' : '否';
});
$grid->column('goods_type', '是否代购')->display(function ($val) {
return ($val == 1) ? '是' : '否';
});
$grid->column('is_show', '状态')->switch('', true);
//$grid->column('updated_at')->sortable();
......@@ -149,7 +152,7 @@ protected function form()
$form->image('cover_img')
->url('upload/goods')
->deleteUrl('upload/delete-public-oss-file')
->autoUpload();
->autoUpload()->help("仅支持jpg、jpeg、png格式图片上传,尺寸大小 280px * 280px");
// $form->image('cover_img')
// ->accept('jpg,jpeg,png')
// ->maxSize(4096)
......@@ -163,14 +166,15 @@ protected function form()
// ->help('仅支持jpg、jpeg、png格式图片上传(尺寸 750px*750px)')
// ->limit(5)
// ->autoUpload()->saveAsJson();
$form->multipleImage('carousel', '产品图')
$form->multipleImage('carousel', '轮播图')
->accept('jpg,jpeg,png')
->maxSize(51200)
->url('upload/goods')
->help('仅支持jpg、jpeg、png格式图片上传')
->help('仅支持jpg、jpeg、png格式图片上传,尺寸大小 750px * 600px')
->limit(9)
->autoUpload()->saveAsJson();
$form->switch('is_show', '上架状态')->default(1);
$form->switch('goods_type', '是否代购产品')->default(0);
$form->switch('is_hot', '是否推荐')->default(0);
$form->text('sort', '排序')->default(0)->help('越大越靠前');
$form->disableCreatingCheck();
......
<?php
namespace App\Admin\Controllers;
use App\Models\City;
use App\Models\HfProvAreaCode;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;
use Illuminate\Http\Request;
class HfProvAreaCodeController extends AdminController
{
public function getList(Request $request)
{
$code = $request->get('q');
$id = HfProvAreaCode::where('area_code', $code)->value('id');
return HfProvAreaCode::where('parent_id', $id)->select(['area_code as id', 'title as text'])->get();
}
}
<?php
namespace App\Admin\Controllers;
use App\Models\Merchant;
use App\Models\OrderDivideRecord;
use App\Models\User;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;
use App\Admin\Actions\TransferToPlatForm;
class OrderDivideRecordController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(OrderDivideRecord::with(['order', 'users']), function (Grid $grid) {
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('order.order_sn', '订单号');
$grid->column('users.phone', '下单会员手机号');
//$grid->column('og_id', '订单商品ID');
$grid->column('order_price', '订单商品价格');
$grid->column('divide_price', '佣金');
//$grid->column('proportion', '分佣比例%');
$grid->column('sh_type', '推荐类型')->display(function ($val) {
$arr = ['平台', '直推', '间推', '商家'];
return $arr[$val];
});
$grid->column('is_div', '是否分账')->display(function ($val) {
return $val == 1 ? '是' : '否';
});
$grid->column('um_id', '推荐公司/分享人')->display(function ($val) {
$stype = $this->sh_type;
$name = '';
if ($stype == 3) {
$name = Merchant::where('id', $val)->value('name');
} else {
$name = $stype ? User::where('id', $val)->value('phone') : '';
}
return $name;
});
$grid->column('remark', '备注')->width(80);
$grid->column('created_at');
//$grid->column('updated_at')->sortable();
$grid->disableCreateButton();
$grid->disableViewButton();
$grid->disableEditButton();
$grid->disableDeleteButton();
$grid->disableRowSelector();
$grid->filter(function (Grid\Filter $filter) {
// 更改为 panel 布局
$filter->panel();
$filter->like('order.order_sn', '订单号')->width(3);
});
$grid->actions(function (Grid\Displayers\Actions $actions) {
//分账给平台
if ($actions->row->is_div == 0 && in_array($actions->row->sh_type, [1, 2])) {
$actions->append(new TransferToPlatForm('分账给平台', $actions->row->id));
}
});
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new OrderDivideRecord(), function (Show $show) {
$show->field('id');
$show->field('order_id');
$show->field('user_id');
$show->field('og_id');
$show->field('order_price');
$show->field('divide_price');
$show->field('proportion');
$show->field('sh_type');
$show->field('is_div');
$show->field('remark');
$show->field('um_id');
$show->field('created_at');
$show->field('updated_at');
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new OrderDivideRecord(), function (Form $form) {
$form->display('id');
$form->text('order_id');
$form->text('user_id');
$form->text('og_id');
$form->text('order_price');
$form->text('divide_price');
$form->text('proportion');
$form->text('sh_type');
$form->text('is_div');
$form->text('remark');
$form->text('um_id');
$form->display('created_at');
$form->display('updated_at');
});
}
}
......@@ -15,6 +15,7 @@
use Dcat\Admin\Widgets\Card;
use Dcat\Admin\Http\Controllers\AdminController;
use App\Admin\Forms\VerifierCodeForm;
use App\Admin\Forms\ShippingForm;
use Dcat\Admin\Admin;
......@@ -28,7 +29,7 @@ class OrderInfoController extends AdminController
protected function grid()
{
return Grid::make(OrderInfo::with(['user', 'merchant']), function (Grid $grid) {
$grid->model()->orderBy('created_at', 'DESC');
$grid->model()->orderBy('id', 'DESC');
$grid->column('id')->sortable();
$grid->column('order_sn', '订单号')->width(80);
$grid->column('mobile', '手机号');
......@@ -116,6 +117,17 @@ protected function grid()
// 传递当前行字段值
return VerifierCodeForm::make()->payload(['id' => $this->id]);
});
//下单送货上门、门店自提均需要核销码用户确认,无需后台接入发货管理(放在核销员端)
// ->if(function ($column) {
// return ($column->getValue() == 3 && $this->shipping_type == 0);
// })->display('点击发货')->modal(function (Grid\Displayers\Modal $modal) {
// // 标题
// $modal->title('发货');
// // 自定义图标
// $modal->icon('feather icon-edit');
// // 传递当前行字段值
// return ShippingForm::make()->payload(['id' => $this->id]);
// })
$grid->column('verification_code', '核销码')->limit(10);
$grid->column('verifier', '核销信息')->if(function ($column) {
return $column->getValue();
......@@ -136,11 +148,13 @@ protected function grid()
})->else(function ($column) {
return '';
});
//$grid->column('updated_at')->sortable();
//$grid->disableActions();
$grid->disableCreateButton();
$grid->disableViewButton();
$grid->filter(function (Grid\Filter $filter) {
// 更改为 panel 布局
$filter->panel();
......
......@@ -72,7 +72,7 @@ protected function form()
$form->display('id');
//$form->ignore(['pwd']); // 忽略password字段
$form->text('name')->required();
$form->text('username');
$form->text(column: 'username');
if ($form->isCreating()) {
$form->password('password', '密码')->saving(function ($password) {
return bcrypt($password);
......
......@@ -2,12 +2,13 @@
namespace App\Admin\Controllers;
use App\Handlers\AilOss;
use App\Handlers\AliOss;
use OSS\Core\OssException;
use Dcat\Admin\Traits\HasUploadedFile;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\Facades\Image;
use App\Models\Adapay;
class UploadController
{
......@@ -20,7 +21,7 @@ class UploadController
public function deleteOssFile()
{
$ossPath = request()->post('key') ?? '';
$aliOss = new AilOss();
$aliOss = new AliOss();
$res = $aliOss->delete($ossPath);
return $res ? $this->responseDeleted() : $this->responseDeleteFailed('文件删除失败');
}
......@@ -31,7 +32,7 @@ public function deleteOssFile()
public function deletePublicOssFile()
{
$ossPath = request()->post('key') ?? '';
$aliOss = new AilOss();
$aliOss = new AliOss();
if (strstr($ossPath, 'aliyuncs') !== false) {
$res = $aliOss->delete($ossPath); //, 'OSS_BUCKET'
return $res ? $this->responseDeleted() : $this->responseDeleteFailed('文件删除失败');
......@@ -110,7 +111,7 @@ public function userUpload()
*/
public function goodsUpload()
{
$aliOss = new AilOss();
$aliOss = new AliOss();
// 获取上传的文件
$file = $this->file();
......@@ -135,43 +136,10 @@ public function goodsUpload()
}
public function goodsUpload2()
{
$disk = $this->disk();
// 判断是否是删除文件请求
if ($this->isDeleteRequest()) {
// 删除文件并响应
return $this->deleteFileAndResponse();
}
// 获取上传的文件
$file = $this->file();
//获取文件扩展名
$ext = $file->getClientOriginalExtension();
$img = Image::make($file->getRealPath())
->resize(640, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->encode($ext, 90);
$dir = '/goods/' . date("Ymd");
$newName = md5(uniqid()) . '.' . $ext;
$path = "{$dir}/$newName";
$result = $disk->put($path, $img);
return $result
? $this->responseUploaded($path, $disk->url($path))
: $this->responseErrorMessage('文件上传失败');
}
//商品规格图
public function uploadSkuImage(Request $request)
{
$aliOss = new AilOss();
$aliOss = new AliOss();
if ($request->hasFile('file')) {
$file = $request->file('file');
$disk = $this->disk();
......@@ -187,43 +155,14 @@ public function uploadSkuImage(Request $request)
return ['url' => env('OSS_PUBLIC_IMAGE_URL') . $ossFilePath];
}
}
public function uploadSkuImage2(Request $request)
{
if ($request->hasFile('file')) {
$file = $request->file('file');
//$disk = Storage::disk('cosv5');
// $ext = $file->getClientOriginalExtension();
$disk = $this->disk();
// $url = 'sku';
// $res = $disk->put($url, $file);
//获取文件扩展名
$ext = $file->getClientOriginalExtension();
$img = Image::make($file->getRealPath())
->resize(640, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->encode($ext, 90);
$dir = '/goods/' . date("Ymd");
$newName = md5(uniqid()) . '.' . $ext;
$path = "{$dir}/$newName";
$result = $disk->put($path, $img);
$url = $result ? $path : '';
// 返回格式
return ['url' => env('IMAGE_URL') . $url];
}
return [];
}
//轮播图
public function carouselUpload()
{
$aliOss = new AilOss();
$aliOss = new AliOss();
// 获取上传的文件
$file = $this->file();;
$file = $this->file();
Image::make($file->getRealPath())
->resize(640, null, function ($constraint) {
$constraint->aspectRatio();
......@@ -241,6 +180,41 @@ public function carouselUpload()
? $this->responseUploaded(env('OSS_PUBLIC_IMAGE_URL') . $ossFilePath, '')
: $this->responseErrorMessage('文件上传失败');
}
//汇付图片(先调用汇付,再调用alioss)
public function huifuUpload()
{
//汇付类型
// $file_type = [
// 'social_credit_code_id' => '01',
// 'legal_cert_id_front_id' => '02',
// 'legal_cert_id_back_id' => '03',
// ];
// $upload_column = $_POST['upload_column'] ?? '';
$aliOss = new AliOss();
// 获取上传的文件
$file = $this->file();
$ext = $file->getClientOriginalExtension();
// Image::make($file->getRealPath())
// ->resize(640, null, function ($constraint) {
// $constraint->aspectRatio();
// $constraint->upsize();
// })->encode('jpg', 90);
$fileName = uniqid() . '.' . $ext;
$date = date('Ymd');
$ossFilePath = 'huifu/' . $date . '/' . $fileName;
//获取文件的绝对路径
$path = $file->getRealPath();
$res = $aliOss->upload($ossFilePath, $path, 'OSS_PUBLIC_BUCKET');
return $res
? $this->responseUploaded(env('OSS_PUBLIC_IMAGE_URL') . $ossFilePath, '')
: $this->responseErrorMessage('文件上传失败');
}
public function carouselUpload2()
{
$disk = $this->disk();
......
......@@ -5,6 +5,7 @@
use App\Admin\Forms\EditPermission;
use App\Admin\Forms\updatePassword;
use App\Admin\Actions\UserBuyCode;
use App\Admin\Actions\EditShareUserAct;
use Dcat\Admin\Grid\RowAction;
use App\Models\User;
use App\Models\UserPermission;
......@@ -46,9 +47,10 @@ protected function grid()
//$grid->simplePaginate();
$grid->actions(function (Grid\Displayers\Actions $actions) {
$actions->append(new EditShareUserAct('更改所属上级', $actions->row->id));
$actions->append(new UserBuyCode($actions->row->id));
// 添加一个按钮,并设置其属性
$actions->append('<a href="/user-share?id=' . $this->id . '" alt="查看下级" target="_blank">查看下级</a>');
$actions->append('<a href="/user-share?id=' . $this->id . '" alt="查看下级" target="_blank"><i class="feather icon-list"> 查看下级 </i></a>');
// 或者使用 RowAction 来添加按钮
//$actions->append(RowAction::make('自定义按钮')->route('custom.route'));
......
<?php
namespace App\Admin\Forms;
use App\Admin\Actions\UserBuyCode;
use App\Command\Log;
use App\Models\Company;
use App\Models\Employee;
use App\Models\Income;
use App\Models\Merchant;
use App\Models\Pay;
use App\Models\User;
use App\Models\UserBuycodeCheck;
use Dcat\Admin\Widgets\Form;
use Dcat\Admin\Contracts\LazyRenderable;
use Dcat\Admin\Traits\LazyWidget;
use Exception;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Request;
class EditShareUserForm extends Form implements LazyRenderable
{
use LazyWidget;
/**
* Handle the form request.
*
* @param array $input
*
* @return mixed
*/
public function handle(array $input)
{
DB::beginTransaction();
try {
$user_id = $this->payload['uid'];
$phone = trim($input['phone']); //推荐人手机号
$spObj = User::where('phone', $phone)->first();
if (!$spObj) {
throw new Exception('该推荐人信息不存在!');
}
$uObj = User::find($user_id);
Log::add('更改推荐人前信息uid:' . $user_id, ['spuid' => $uObj->spuid, 'second_spuid' => $uObj->second_spuid]);
if ($uObj) {
$uObj->spuid = $spObj->id; //直推
$uObj->second_spuid = $spObj->spuid ?? 0; //间推
$uObj->save();
Log::add('更改推荐人后信息uid:' . $user_id, ['spuid' => $uObj->spuid, 'second_spuid' => $uObj->second_spuid]);
}
DB::commit();
} catch (\Exception $exception) {
DB::rollBack();
return $this->response()->error($exception->getMessage())->refresh();
}
return $this->response()->success('提交成功')->refresh();
}
/**
* Build a form here.
*/
public function form()
{
$this->text('phone', '推荐手机号');
}
/**
* The data of the form.
*
* @return array
*/
public function default()
{
// 获取外部传递参数
return [];
}
}
<?php
namespace App\Admin\Forms;
use App\Command\Log;
use App\Models\OrderInfo;
use Dcat\Admin\Widgets\Form;
use Dcat\Admin\Contracts\LazyRenderable;
use Dcat\Admin\Traits\LazyWidget;
use App\Handlers\MpAaccessToken;
use App\Models\PaymentRecord;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use DateTime;
use DateTimeZone;
use Exception;
//发货
class ShippingForm extends Form implements LazyRenderable
{
use LazyWidget;
/**
* Handle the form request.
*
* @param array $input
*
* @return mixed
*/
public function handle(array $input)
{
$mpTokenObj = new MpAaccessToken();
$dateTime = new DateTime();
$dateTime->setTimezone(new DateTimeZone('Asia/Shanghai'));
$upload_time = $dateTime->format('Y-m-d\TH:i:s.vP');
$shipping_type = intval($input['shipping_type']);
$shipping_name = trim($input['shipping_name']);
$shipping_code = trim($input['shipping_code']);
$shipping_goods = trim($input['shipping_goods']);
$order_id = $this->payload['id'];
$order = OrderInfo::find($order_id);
$order->shipping_type = $shipping_type;
$order->shipping_code = $shipping_code;
$order->shipping_name = $shipping_name;
$order->shipping_goods = $shipping_goods;
$order->shipping_at = date("Y-m-d H:i:s");
try {
//接入微信小程序发货管理
if (1) {
//付款记录
$recordObj = PaymentRecord::where('order_sn', $order->order_sn)->first();
$transaction_id = $recordObj->other_order;
$payerOpenid = User::where('id', $recordObj->uid)->value('openid');
$access_token = $mpTokenObj->getAccessToken();
$url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token=" . $access_token;
$data = [
"order_key" => [
"order_number_type" => 2,
"transaction_id" => $transaction_id,
],
"logistics_type" => 4,
"delivery_mode" => 1,
"shipping_list" => [
["item_desc" => $order->shipping_goods]
],
"upload_time" => $upload_time,
"payer" => [
"openid" => $payerOpenid,
]
];
$headers = array("Content-type: application/json;charset=UTF-8");
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
// 设置HTTP头部
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE));
$response = curl_exec($curl);
$result = json_decode($response, true);
// 关闭cURL会话
curl_close($curl);
Log::add('发货录入', $result);
if ($result['errcode'] != 0) {
throw new Exception($result['errmsg']);
}
}
DB::commit();
} catch (\Exception $exception) {
DB::rollBack();
return $this->response()->error($exception->getMessage())->refresh();
}
return $this->response()->success('确认成功')->refresh();
}
/**
* Build a form here.
*/
public function form()
{
$this->radio('shipping_type', '发货方式')
->when([1, 2], function (Form $form) {
$form->text('shipping_name', '快递公司');
$form->text('shipping_code', '快递单号');
})
->options([
1 => '物流快递',
2 => '同城配送',
3 => '用户自提',
4 => '虚拟发货',
])
->default(1);
$this->text('shipping_goods', '商品信息')->required();
}
/**
* The data of the form.
*
* @return array
*/
public function default()
{
// 获取外部传递参数
return [];
}
}
<?php
namespace App\Admin\Forms;
use App\Models\OrderDivideRecord;
use App\Command\Log;
use App\Models\OrderInfo;
use App\Models\Adapay;
use App\Models\User;
use App\Models\PaymentRecord;
use Dcat\Admin\Widgets\Form;
use Dcat\Admin\Contracts\LazyRenderable;
use Dcat\Admin\Traits\LazyWidget;
use App\Models\HfPayconfirm;
use Exception;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Request;
class TransferBillsPlatForm extends Form implements LazyRenderable
{
use LazyWidget;
/**
* Handle the form request.
*
* @param array $input
*
* @return mixed
*/
public function handle(array $input)
{
$payment_confirm = new \NwVVVS\AdapaySdk\PaymentConfirm(); //支付确认
$id = $this->payload['id'];
DB::beginTransaction();
try {
$remark = trim($input['remark']);
$recordObj = OrderDivideRecord::find($id);
if (!$recordObj && $recordObj->is_div == 1) {
throw new Exception('数据不存在或该用户已分账!');
}
$divide_price = $recordObj->divide_price; //分账佣金
$um_id = $recordObj->um_id; //推荐分享人
$userObj = User::find($um_id);
Log::add('推荐人信息', $userObj->toArray());
//交易记录
$order_no = OrderInfo::where('id', $recordObj->order_id)->value('order_sn');
$prObj = PaymentRecord::where('order_sn', $order_no)->first();
# 支付确认参数设置
$payment_params = array(
"payment_id" => $prObj->payment_id,
"order_no" => 'payconfirm_' . date("YmdHis") . rand(100000, 999999),
"confirm_amt" => $divide_price,
"description" => "",
"div_members" => "" //分账参数列表 默认是数组List
);
$userObj->total_revenue -= $divide_price;
$userObj->save();
Log::add('推荐人账户更新信息', $userObj->toArray());
# 发起支付确认创建
$payment_params['div_members'] = ['member_id' => 0, 'amount' => sprintf("%.2f", $divide_price), 'fee_flag' => 'Y'];
$result = (new Adapay())->createPaymentConfirm($payment_params);
# 对支付确认创建结果进行处理
if ($result['status'] == 'succeeded') {
//成功处理
Log::add('分账给平台成功', ['recond_id' => $recordObj->id]);
$recordObj->remark = $remark;
$recordObj->payconfirm_no = $result['order_no'];
$recordObj->is_div = 1;
$recordObj->um_id = 0;
$recordObj->sh_type = 0;
$recordObj->save();
//写入支付确认信息
(new HfPayconfirm())->add($payment_params, $result['fee_amt']);
}
DB::commit();
} catch (\Exception $exception) {
DB::rollBack();
return $this->response()->error($exception->getMessage())->refresh();
}
return $this->response()->success('提交成功')->refresh();
}
/**
* Build a form here.
*/
public function form()
{
$this->text('remark', '备注')->required();
}
/**
* The data of the form.
*
* @return array
*/
public function default()
{
// 获取外部传递参数
return [];
}
}
......@@ -29,6 +29,8 @@
$router->match(['put', 'post'], 'upload/carousel', 'UploadController@carouselUpload'); //上传轮播图
$router->match(['put', 'post'], 'upload/huifu', 'UploadController@huifuUpload'); //上传汇付平台图片
$router->match(['put', 'post'], 'upload/article', 'UploadController@articleUpload'); //上传文章图
$router->match(['put', 'post'], 'upload/skuImage', 'UploadController@uploadSkuImage'); //上传商品规格图
......@@ -42,6 +44,9 @@
$router->resource('category', 'CategoryController'); //分类管理
$router->resource('category-test', 'CategoryControllerTest'); //对账单下载-页面
$router->get('category-download','CategoryControllerTest@download'); //对账单下载-下载
$router->resource('article', 'ArticleController'); //文章管理
$router->resource('goods', 'GoodController'); //商品管理
......@@ -52,6 +57,8 @@
$router->resource('orderInfo', 'OrderInfoController'); //订单管理
$router->resource('order-divide-record', 'OrderDivideRecordController'); //订单分佣记录
$router->resource('user', 'UserController'); //用户管理
$router->resource('user-share', 'ShareController'); //查看下级
......@@ -76,5 +83,10 @@
$router->get('city', 'CityController@getList'); //城市选择-联动
$router->get('hf-area-code', 'HfProvAreaCodeController@getList'); //汇付城市编码-联动
$router->get('get-store-list', 'MerchantGoodsStoreController@getList'); //门店选择-联动
$router->resource('hf-company-member', 'HfCompanyMemberController'); //汇付天下-企业用户
});
<?php
namespace App\Command;
use Illuminate\Http\Request;
class Log{
static public function add(string $logKey, mixed $logInfo) :void{
//判断当天的日志文件是否存在
$day = date('Y-m-d');
$logFileName = 'runLog_'.$day.'.log';
$logPath = storage_path("logs/".$logFileName);
file_put_contents($logPath,date('【 H:i:s 】'.$logKey.': ').print_r($logInfo,true),FILE_APPEND);
static public function add(string $logKey, mixed $logInfo, ?Request $request = null) :void{
try {
// 判断当天的日志文件是否存在
$day = date('Y-m-d');
$logFileName = 'runLog_'.$day.'.log';
$logPath = storage_path("logs/".$logFileName);
// 检查日志目录是否存在,如果不存在则创建
if (!is_dir(dirname($logPath))) {
mkdir(dirname($logPath), 0777, true);
}
// 拼接用户信息
if ($request && $request->user()) {
$userObj = $request->user();
$userInfo = "【-----------用户信息----------】".PHP_EOL;
$userInfo .= "【用户ID】: ".$userObj->id.";".PHP_EOL;
$userInfo .= "【用户名称】: ".$userObj->name.";".PHP_EOL;
// 添加请求参数到日志信息
$requestParams = $request->all();
$paramInfo = "【请求参数】: ".print_r($requestParams, true).PHP_EOL;
$userInfo .= $paramInfo;
} else {
$userInfo = "【-----------用户信息----------】".PHP_EOL;
$userInfo .= "【未获取到用户信息】".PHP_EOL;
}
// 获取请求路径
$requestPath = $request ? $request->getPathInfo() : 'N/A';
// 添加请求路径到日志信息
$logMessage = "--------------------".str_repeat("-", 20).PHP_EOL;
$logMessage .= "【".date('Y-m-d H:i:s')."】".PHP_EOL."【返回值:】".$userInfo."【请求路径】: $requestPath 【".$logKey."】: ".print_r($logInfo, true).PHP_EOL;
$logMessage .= "--------------------".str_repeat("-", 20).PHP_EOL.PHP_EOL;
// 添加换行符
file_put_contents($logPath, $logMessage, FILE_APPEND);
} catch (\Exception $e) {
// 记录异常信息到另一个日志文件
$errorLogPath = storage_path("logs/error_log.log");
file_put_contents($errorLogPath, "【".date('Y-m-d H:i:s')."】【add日志 方法出错】: ". $e->getMessage(). PHP_EOL, FILE_APPEND);
}
}
}
......@@ -3,7 +3,7 @@
class Tools{
//计算俩地距离
// 计算俩地距离
function get_two_point_distance($lat1,$lng1,$lat2,$lng2)
{
$radLat1 = deg2rad($lat1);//deg2rad()函数将角度转换为弧度
......@@ -16,5 +16,28 @@ function get_two_point_distance($lat1,$lng1,$lat2,$lng2)
return round($s,2);//返回公里数
}
// 新增结算日期计算方法
public static function calculateSettlementDate(\Carbon\Carbon $date)
{
// 在原有的 T + 1 基础上额外加 5 小时
$settlementDate = $date->copy()->addDay()->addHours(5);
// 跳过周末(需补充节假日判断)
while ($settlementDate->isWeekend()) {
$settlementDate->addDay();
}
return $settlementDate;
}
// 计算 T+1 未到账金额
public static function calculatePendingCashout($merchant_id)
{
return \App\Models\OrderDivideRecord::where('um_id', $merchant_id)
->get()
->filter(function ($record) {
$createdAt = $record->created_at;
$settlementDate = self::calculateSettlementDate($createdAt);
// 修改为通过秒来判断
return now()->timestamp <= $settlementDate->timestamp;
})->sum('divide_price');
}
}
<?php
namespace App\Handlers;
use Exception;
use OSS\OssClient;
use OSS\Core\OssException;
require_once '../vendor/aliyuncs/oss-sdk-php/autoload.php';
class AliOss
{
public static $oss;
/**
* @throws \OSS\Core\OssException
*/
public function __construct()
{
$accessKeyId = env('OSS_ACCESS_KEY_ID'); //获取阿里云oss的accessKeyId
$accessKeySecret = env('OSS_ACCESS_KEY_SECRET'); //获取阿里云oss的accessKeySecret
$endpoint = env('OSS_ENDPOINT'); //获取阿里云oss的endPoint
self::$oss = new OssClient($accessKeyId, $accessKeySecret, $endpoint); //实例化OssClient对象
}
/**
*
* 使用阿里云oss上传文件
* @param $object 保存到阿里云oss的文件名
* @param $filepath 文件在本地的绝对路径
* @return bool 上传是否成功
* @throws \OSS\Core\OssException
*/
public function upload($object, $filepath, $bucket = 'OSS_BUCKET')
{
$res = false;
$bucket = env($bucket); //获取阿里云oss的bucket
try {
self::$oss->uploadFile($bucket, $object, $filepath);
} catch (OssException $e) {
print_r($e->getMessage());
die;
}
if (self::$oss->uploadFile($bucket, $object, $filepath)) { //调用uploadFile方法把服务器文件上传到阿里云oss
$res = true;
}
return $res;
}
/**
* 删除指定文件
* @param $object string 被删除的文件名
* @return bool 删除是否成功
*/
public function delete(string $object, $bucket = 'OSS_BUCKET')
{
$res = false;
$bucket = env($bucket);
if (self::$oss->deleteObject($bucket, $object)) { //调用deleteObject方法把服务器文件上传到阿里云oss
$res = true;
}
return $res;
}
/**
* 删除指定文件
* @param $object 被删除的文件名
* @return bool 删除是否成功
*/
public function delete_array($objects, $bucket = 'OSS_BUCKET')
{
$res = false;
$bucket = env($bucket);
if (self::$oss->deleteObjects($bucket, $objects)) { //调用deleteObject方法把服务器文件上传到阿里云oss
$res = true;
}
return $res;
}
/*获取文件的临时访问URL*/
public function getUrl($OssFilePath, $time = 1800, $bucket = 'OSS_BUCKET')
{
// 生成一个带签名的URL,有效期是3600秒,可以直接使用浏览器访问。
$timeout = $time;
$bucket = env($bucket);
return self::$oss->signUrl($bucket, $OssFilePath, $timeout, "GET");
}
/**
* 在OSS中创建虚拟“文件夹”。名称不应以“/”结尾,因为该方法无论如何都会用“/”追加名称。
*
* Internal use only.
*
* @param string $dirName 文件夹名称
* @return bool
*/
public function createDir($dirName, $bucket = 'OSS_BUCKET')
{
$res = false;
$bucket = env($bucket);
if (self::$oss->createObjectDir($bucket, $dirName)) {
$res = true;
}
return $res;
}
/*获取指定目录下的目录与文件*/
public function fileList($dir, $maxKey = 1000, $delimiter = '/', $nextMarker = '')
{
$fileList = []; // 获取的文件列表, 数组的一阶表示分页结果
$dirList = []; // 获取的目录列表, 数组的一阶表示分页结果
$storageList = [
'file' => [], // 真正的文件数组
'dir' => [], // 真正的目录数组
];
while (true) {
$options = [
'delimiter' => $delimiter,
'prefix' => $dir,
'max-keys' => $maxKey,
'marker' => $nextMarker,
];
$bucket = env('OSS_BUCKET');
try {
$fileListInfo = self::$oss->listObjects($bucket, $options);
// 得到nextMarker, 从上一次 listObjects 读到的最后一个文件的下一个文件开始继续获取文件列表, 类似分页
} catch (\Exception $e) {
return $e->getMessage(); // 发送错误信息
}
$nextMarker = $fileListInfo->getNextMarker();
$fileItem = $fileListInfo->getObjectList();
$dirItem = $fileListInfo->getPrefixList();
$fileList[] = $fileItem;
$dirList[] = $dirItem;
if ($nextMarker === '') break;
}
foreach ($fileList[0] as $item) {
$storageList['file'][] = $this->objectInfoParse($item);
}
foreach ($dirList[0] as $item) {
$storageList['dir'][] = $this->prefixInfoParse($item);
}
return $storageList; // 发送正确信息
}
/* 解析 prefixInfo 类 */
private function prefixInfoParse($prefixInfo)
{
return [
'dir' => $prefixInfo->getPrefix(),
];
}
/* 解析 objectInfo 类 */
public function objectInfoParse($objectInfo)
{
return [
'name' => $objectInfo->getKey(),
'size' => $objectInfo->getSize(),
'update_at' => $objectInfo->getLastModified(),
];
}
}
<?php
namespace App\Handlers;
use Illuminate\Support\Facades\Cache;
//小程序accesstoken
class MpAaccessToken
{
private $appId;
private $appSecret;
public function __construct()
{
$this->appId = env('WX_XCX_APPID');
$this->appSecret = env('WX_XCX_KEY');
}
public function getAccessToken()
{
// access_token 应该全局存储与更新,以下代码以写入到文件中做示例
//$data = json_decode(file_get_contents("access_token.json"));
$token = Cache::get('access_token_expire_time');
$data = $token ? $token : ['expire_time' => 0];
if ($data['expire_time'] < time()) {
// 如果是企业号用以下URL获取access_token
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$this->appId&secret=$this->appSecret";
$res = json_decode($this->httpGet($url));
$access_token = $res->access_token;
if ($access_token) {
$data['expire_time'] = time() + 7000;
$data['access_token'] = $access_token;
Cache::set('access_token_expire_time', $data);
}
} else {
$access_token = $data['access_token'];
}
return $access_token;
}
private function httpGet($url)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);
return $res;
}
}
......@@ -42,3 +42,25 @@ function togetherFilePath($path = '')
}
return $path;
}
function curl_post_request($url, $data)
{
$headers = array("Content-type: application/json;charset=UTF-8");
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
// 设置HTTP头部
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE));
$response = curl_exec($curl);
$result = json_decode($response, true);
// 关闭cURL会话
curl_close($curl);
return $result;
}
......@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
use App\Models\OrderDivideRecord;
use App\Command\Log;
use App\Handlers\QqCos;
use App\Handlers\FileUploadHandler;
......@@ -24,6 +25,22 @@ public function getList()
$list[$key]['imgUrl'] = ($val->imgUrl ? $val->imgUrl : "");
}
return $this->JsonResponse($list);
// 从.env文件中获取is_examine的值,如果不存在则默认为0
$is_examine = env('IS_EXAMINE', 0);
$data['info'] = $list;
$data['is_examine'] = $is_examine;
return $this->JsonResponse($data);
}
//测试订单分佣
public function orderDiv(Request $request)
{
$order_id = $request->order_id ?? 0;
//分账列表
$payment_params = OrderDivideRecord::divide($order_id); //返回分账参数列表
echo "<pre>";
print_r($payment_params);
}
}
......@@ -190,9 +190,9 @@ public function getIndexGoods(Request $request)
'id' => $datum->id,
'goods_name' => $datum->goods_name,
'is_hot' => $datum->is_hot,
'dg_price' => floor($dg_price),
'market_price' => floor($market_price),
'goods_price' => $mer_id ? floor($dg_price) : floor($market_price),
'dg_price' => sprintf('%.1f', $dg_price),
'market_price' => sprintf('%.1f', $market_price),
'goods_price' => $mer_id ? sprintf('%.1f', $dg_price) : sprintf('%.1f', $market_price),
'tags' => $tags,
'cover_img' => togetherFilePath($datum->cover_img),
];
......@@ -263,9 +263,9 @@ public function getDetail(Request $request)
$data = [
'id' => $goods->id,
'goods_img' => $cover,
'dg_price' => floor($dg_price),
'goods_price' => $mer_id ? floor($dg_price) : floor($market_price),
'market_price' => floor($market_price),
'dg_price' => sprintf('%.2f', $dg_price),
'goods_price' => $mer_id ? sprintf('%.2f', $dg_price) : sprintf('%.2f', $market_price),
'market_price' => sprintf('%.2f', $market_price),
'stock' => $stock,
'goods_name' => $goods->goods_name,
'sale' => $goods->sale ?? 0,
......
<?php
namespace App\Http\Controllers\Api;
use App\Command\Log;
use App\Models\Merchant;
use App\Models\User as UserModel;
use App\Models\OrderDivideRecord;
use Illuminate\Http\Request;
use App\Models\Adapay;
use App\Models\HfCompanyMember;
class HfCompanyMemberController extends BaseController
{
//已废弃
//创建企业用户
public function create(Request $request)
{
// $mer_id = $request->user()->merchant_id;
// $merObj = Merchant::where('id', $mer_id)->first();
$member = new \NwVVVS\AdapaySdk\CorpMember();
//$file_real_path = realpath('123.zip');
$url = 'https://amy8888.oss-cn-shanghai.aliyuncs.com/carousel/20241227/612f0eac39fbace6f8333e8e0c212e30.jpg';
$member_params = array(
# app_id
"app_id" => "app_c383f483-3c2a-41b6-8d21-7f597dde4c50",
# 商户用户id
"member_id" => "hf_test_member_id3",
# 订单号
"order_no" => date("YmdHis") . rand(100000, 999999),
# 企业名称
"name" => "测试企业",
# 省份
"prov_code" => "0031",
# 地区
"area_code" => "3100",
# 统一社会信用码
"social_credit_code" => "social_credit_code",
"social_credit_code_expires" => "20301109",
# 经营范围
"business_scope" => "123123",
# 法人姓名
"legal_person" => "frname",
# 法人身份证号码
"legal_cert_id" => "1234567890",
# 法人身份证有效期
"legal_cert_id_expires" => "20301010",
# 法人手机号
"legal_mp" => "13333333333",
# 企业地址
"address" => "1234567890",
# 邮编
"zip_code" => "企业地址测试",
# 企业电话
"telphone" => "1234567890",
# 企业邮箱
"email" => "1234567890@126.com",
# 上传附件
"attach_file" => $url,
# 银行代码
"bank_code" => "1001",
# 银行账户类型
"bank_acct_type" => "1",
);
$res = (new Adapay())->createCompany();
# 创建企业用户
// $member->create($member_params);
// # 对创建企业用户结果进行处理
// if ($member->isError()) {
// //失败处理
// var_dump($member->result);
// } else {
// //成功处理
// var_dump($member->result);
// }
return $this->JsonResponse([]);
}
//异步通知
public function notify()
{
Log::add('--创建企业用户回调结果--', $_POST);
$params = $_POST ?? [];
$adapay_tools = new \NwVVVS\AdapaySdk\AdapayTools();
$post_data = json_decode($params['data'], 1);
$post_data_str = json_encode($post_data, JSON_UNESCAPED_UNICODE);
$post_sign_str = isset($params['sign']) ? $params['sign'] : '';
# 先校验签名和返回的数据的签名的数据是否一致
$sign_flag = $adapay_tools->verifySign($post_data_str, $post_sign_str);
if (!$sign_flag) {
Log::add('创建企业用户回调签名验证失败', []);
return false;
}
$member_id = $post_data['member_id'];
$order_no = $post_data['order_no'];
$hfcObj = HfCompanyMember::where(['member_id' => $member_id, 'order_no' => $order_no])->first();
if ($post_data['audit_state'] == 'D') {
$hfcObj->status = 'succeeded';
$hfcObj->audit_state = 'D';
$hfcObj->audit_desc = $post_data['audit_desc'] ?? '';
} else {
$hfcObj->status = 'failed';
$hfcObj->audit_state = $post_data['audit_state'];
$hfcObj->audit_desc = $post_data['audit_desc'] ?? '';
}
$hfcObj->save();
return true;
}
}
<?php
namespace App\Http\Controllers\Api;
use App\Command\Log;
use App\Models\Adapay;
use App\Models\OrderDivideRecord;
use App\Models\Good as GoodModel;
use App\Models\OrderInfo;
use App\Models\OrderGoods;
use App\Models\OrderInfo as OrderInfoModel;
use App\Models\MerchantGoodSku;
use App\Models\PaymentRecord;
use App\Models\HfPayconfirm;
use Dcat\Admin\Grid\Displayers\Orderable;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use League\CommonMark\Node\Query\OrExpr;
class HfOrderController extends BaseController
{
//退款回调
public function refundNotify()
{
Log::add('--撤销回调结果--', $_POST);
$fields = $_POST ?? [];
$res = (new Adapay())->refundNotify($fields);
return $res;
}
//手动创建支付确认对象
public function paymentConfirm(Request $request)
{
$order_id = $request->order_id ?? 0;
$orderObj = OrderInfo::where(['id' => $order_id])->first();
if (!$orderObj) {
return $this->JsonResponse('', '订单不存在', 201);
}
//解冻通知
$order_no = $orderObj->order_sn;
$freeze_stat = $message['freeze_stat'] ?? '';
if ($orderObj->freeze_stat == 'FREEZE') {
//交易记录
$prObj = PaymentRecord::where('order_sn', $order_no)->first();
# 支付确认参数设置
$payment_params = array(
"payment_id" => $prObj->payment_id,
"order_no" => 'payconfirm_' . date("YmdHis") . rand(100000, 999999),
"confirm_amt" => 0,
"description" => "",
"div_members" => "" //分账参数列表 默认是数组List
);
DB::beginTransaction();
try {
//分账列表
$divResult = OrderDivideRecord::divide($orderObj->id, $payment_params['order_no']); //返回分账参数列表
$payment_params['div_members'] = $divResult['div_members'];
$payment_params['confirm_amt'] = $divResult['confirm_amt'];
Log::add('发起支付确认', $payment_params);
$orderObj->freeze_stat = 'UNFREEZE';
if ($orderObj->save()) {
$result = (new Adapay())->createPaymentConfirm($payment_params);
if ($result['status'] == 'succeeded') {
(new HfPayconfirm())->add($payment_params, $result['fee_amt']);
}
}
DB::commit();
} catch (\Exception $e) {
Log::add('解冻,支付确认对象失败', $e->getMessage());
DB::rollBack();
return $this->JsonResponse('', $e->getMessage(), 201);
}
return $this->JsonResponse($result);
}
}
//定时任务--查询支付对象列表
public function autoQueryList()
{
$payment_params = array(
"app_id" => env('HUIFU_APPID'),
//"payment_id" => "10000000000000001",
//"order_no" => "20190919071231283468359213",
"page_index" => "",
"page_size" => "",
"created_gte" => "",
"created_lte" => ""
);
$chunkSize = 10; // 每次处理的订单数量
$orders = OrderInfoModel::where(["freeze_stat" => 'FREEZE'])->orderBy('id', 'desc')->take($chunkSize);
while ($orders->count() > 0) {
$orders->chunk($chunkSize, function ($batch) use ($payment_params) {
foreach ($batch as $order) {
$nowtime = time();
$pyObj = PaymentRecord::where('order_sn', $order->order_sn)->first();
$payment_params['payment_id'] = $pyObj->payment_id;
$payment_params['order_no'] = $pyObj->order_sn;
$result = (new Adapay())->queryList($payment_params);
// if ($order->created_at) {
// $created_at = strtotime($order->created_at);
// $diff_time = $nowtime - $created_at;
// if ($diff_time > 900) {
// $order->save();
// }
// }
}
});
// 移动游标到下一批
$orders->skip($chunkSize);
$orders = $orders->getQuery();
sleep(2);
}
return '--ok--';
}
}
<?php
namespace App\Http\Controllers\Api;
use App\Command\Log;
use Illuminate\Http\Request;
use Exception;
use Illuminate\Support\Facades\DB;
class HfProvAreaCodeController extends BaseController
{
public function getList(Request $request)
{
$parent_id = $request->parent_id ?? 0;
$where = [
'parent_id' => $parent_id
];
$data = DB::table('hf_prov_area_code')->select("id", "parent_id", "area_code", "title")
->where($where)
->limit(100)
->get()->toArray();
return $this->JsonResponse($data);
}
}
......@@ -9,6 +9,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use App\Models\Adapay;
class LoginController extends BaseController
{
......@@ -61,7 +62,7 @@ public function getOpenid(Request $request)
$url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' . $appid . '&secret=' . $secret . '&js_code=' . $jsCode . '&grant_type=authorization_code';
$wx_data = json_decode(file_get_contents($url), true);
if (isset($wx_data['errcode'])) {
Log::add('请求微信接口异常', $wx_data);
Log::add('getOpenid请求微信接口异常', $wx_data,$request);
return $this->JsonResponse('', '请求微信接口异常', 201);
}
return $this->JsonResponse([
......@@ -101,17 +102,22 @@ public function login(Request $request)
$user->total_revenue = 0;
$user->save();
}
if ($user->openid != $openId) {
$user->openid = $openId;
$user->save();
//对接汇付-创建个人对象
if (!$user->member_id) {
$result = (new Adapay())->createMember($user->id, $user->phone);
if (isset($result['status']) && $result['status'] == 'succeeded') {
DB::table('users')->where('id', $user->id)->update(['member_id' => $result['member_id']]);
}
}
//生成token
$accessToken = 'Bearer ' . $user->createToken('Access-token')->plainTextToken;
Log::add('用户--' . $user->id . '登录', ['token' => $accessToken]);
return $this->JsonResponse([
$return = $this->JsonResponse([
'Authorization' => $accessToken,
]);
Log::add('用户--' . $user->id . '登录', '返回值:'.$return,$request);
return $return;
}
//商户端授权绑定账号密码(提现时)
......@@ -165,7 +171,7 @@ private function codeToSession($code)
$url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' . $appid . '&secret=' . $secret . '&js_code=' . $code . '&grant_type=authorization_code';
$wx_data = json_decode(file_get_contents($url), true);
if (isset($wx_data['errcode'])) {
Log::add('请求微信接口异常', $wx_data);
Log::add('codeToSession请求微信接口异常', $wx_data);
//return $this->JsonResponse('', '请求微信接口异常', 201);
}
return $wx_data;
......@@ -173,9 +179,42 @@ private function codeToSession($code)
public function testLogin(Request $request)
{
$uid = $request->uid ?? 31;
$uid = $request->uid ?? 7;
$user = User::find($uid);
$accessToken = 'Bearer ' . $user->createToken('Access-token')->plainTextToken;
//对接汇付-创建个人对象
if (!$user->member_id) {
(new Adapay())->createMember($user->id, $user->phone);
}
return $this->JsonResponse(['Authorization' => $accessToken,]);
}
// 模拟登陆
public function simulateLogin(Request $request)
{
// 从请求中获取用户 ID
$userId = $request->input('user_id');
// 根据用户 ID 查找用户
$user = User::find($userId);
// 检查用户是否存在
if (!$user) {
return $this->JsonResponse('', '用户不存在', 201);
}
// 生成访问令牌
$accessToken = 'Bearer ' . $user->createToken('Access-token')->plainTextToken;
// 记录日志
Log::add('用户--' . $user->id . '模拟登录', ['token' => $accessToken]);
// 返回包含 Authorization 信息的响应
return $this->JsonResponse([
'Authorization' => $accessToken
]);
}
}
......@@ -6,7 +6,10 @@
use App\Models\Merchant;
use App\Models\User as UserModel;
use App\Models\OrderDivideRecord;
use App\Models\OrderGoods;
use App\Models\OrderInfo;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class MerchantController extends BaseController
{
......@@ -53,4 +56,44 @@ public function getUserList(Request $request)
return $this->JsonResponse($data);
}
//我的用户-订单列表(展示近10天)
public function getOrderList(Request $request)
{
$mer_id = 4; //$request->user()->merchant_id;
$user_id = $request->user_id ?? 0;
if (!$user_id) {
return $this->JsonResponse('', '参数错误', 201);
}
$daysAgo = date('Y-m-d H:i:s', strtotime("-10 days"));
$list = DB::table("order_divide_record as odr")
->select(DB::raw('odr.order_id, o.order_status,o.created_at'))
->leftJoin('li_order_info as o', 'odr.order_id', '=', 'o.id')
//->whereDate('odr.created_at', '>', $daysAgo)
->where(['odr.sh_type' => 3, 'odr.um_id' => $mer_id, 'odr.user_id' => $user_id])
->limit(100)
->get()
->toArray();
foreach ($list as $key => $item) {
$ogRows = DB::table('li_order_goods')->where('order_id', $item->order_id)
->select(DB::raw('goods_name,goods_number,goods_price,goods_img,goods_attr'))
->get()
->toArray();
$order_goods = [];
foreach ($ogRows as $key => $valObj) {
$tmp = [];
$tmp['goods_name'] = $valObj->goods_name;
$tmp['goods_number'] = $valObj->goods_number;
$tmp['goods_attr'] = $valObj->goods_attr;
$tmp['goods_price'] = $valObj->goods_price;
$tmp['goods_img'] = $valObj->goods_img ? togetherFilePath($valObj->goods_img) : '';
array_push($order_goods, $tmp);
}
$list[$key]->status_txt = OrderInfo::STATUS_OPTIONS[$list[$key]->order_status];
$list[$key]->og = $order_goods;
}
return $this->JsonResponse($list);
}
}
<?php
namespace App\Http\Controllers\Api;
use App\Command\Log;
use App\Models\Carousel;
use App\Models\User;
use App\Models\OrderDivideRecord;
use Illuminate\Http\Request;
class OrderDivideRecordController extends BaseController
{
public function getList(Request $request)
{
$type = $request->type ?? 0;
$page = $request->page ?? 1;
$limit = $request->limit ?? 10;
if (!in_array($type, [1, 2, 3])) {
return $this->JsonResponse('', '参数错误', 201);
}
$userObj = $request->user();
$um_id = ($type == 3) ? $userObj->merchant_id : $userObj->id;
$sql = OrderDivideRecord::where(['um_id' => $um_id, 'sh_type' => $type, 'deleted_at' => null]);
$total = $sql->count();
$data = [
'total' => $total,
'total_page' => ceil($total / $limit),
'list' => []
];
$listData = $sql->offset(($page - 1) * $limit)->limit($limit)->orderBy('created_at', 'DESC')->get();
if ($listData->toArray()) {
foreach ($listData as $kk => $vv) {
$data['list'][] = [
'title' => isset(OrderDivideRecord::COMMISSION_TYPE[$vv->sh_type]) ? OrderDivideRecord::COMMISSION_TYPE[$vv->sh_type] : '',
'created_at' => date("Y-m-d H:i:s", strtotime($vv->created_at)),
'divide_price' => $vv->divide_price
];
}
}
return $this->JsonResponse($data);
}
}
......@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
use App\Command\Tools;
use App\Command\Log;
use App\Handlers\FileUploadHandler;
use App\Models\Merchant;
......@@ -14,21 +15,14 @@
class StoreAdminUsersController extends BaseController
{
/**
* 用户登录方法
*
* @param Request $request HTTP请求对象
* @return \Illuminate\Http\JsonResponse JSON响应
*/
public function login(Request $request)
{
// $user = User::find(1);
// $accessToken = 'Bearer '.$user->createToken('Access-token')->plainTextToken;
// return $this->JsonResponse([ 'Authorization'=>$accessToken,]);
// $encryptedData = $request->encryptedData ?? '';
// $iv = $request->iv ?? '';
// $session_key = $request->session_key ?? '';
// $openId = $request->openid ??'';
// $res = $this->decryptData($session_key,$encryptedData,$iv,$data);
// if($res != 0 ){
// return $this->JsonResponse('','参数异常',201);
// }
$username = $request->username ?? '';
$password = $request->password ?? '';
......@@ -41,8 +35,11 @@ public function login(Request $request)
if (!Hash::check($password, $user->password)) {
return $this->JsonResponse('', '账号或密码错误', 500);
}
//生成token
// 生成token
$accessToken = 'Bearer ' . $user->createToken('Access-token')->plainTextToken;
// 记录登录日志
Log::add('商家端用户--' . $user->id . '登录', ['token' => $accessToken]);
return $this->JsonResponse([
......@@ -50,13 +47,26 @@ public function login(Request $request)
]);
}
/**
* 用户注销方法
*
* @param Request $request HTTP请求对象
* @return \Illuminate\Http\JsonResponse JSON响应
*/
public function logout(Request $request)
{
$request->user()->tokens()->delete();
PersonalAccessToken::where(['tokenable_id' => $request->user()->id])->delete();
return $this->JsonResponse('');
}
/**
* 获取用户信息方法
*
* @param Request $request HTTP请求对象
* @return \Illuminate\Http\JsonResponse JSON响应
*/
public function info(Request $request)
{
$muser = $request->user();
......@@ -65,20 +75,35 @@ public function info(Request $request)
$store_id = $muser->store_id;
$total_revenue = $balance = $cashout = 0;
$store_name = $merchant_name = '';
if ($merchant_id) {
$merObj = Merchant::where('id', $merchant_id)->first();
$buycode = $merObj->buycode;
$phone = $merObj->phone;
$merchant_name = $merObj->name;
$total_revenue = $merObj->total_revenue ?? 0;
$balance = $merObj->balance ?? 0;
$cashout = $total_revenue - $balance;
$balanceValue = $merObj->balance ?? 0;
// 使用 Tools 类计算 T+1 未到账金额
$pendingCashout = Tools::calculatePendingCashout($merchant_id);
// 调整金额计算公式
$displayBalance = $balanceValue + $pendingCashout;
$displayCashout = $total_revenue - $displayBalance;
$balance = number_format($displayBalance, 2, '.', '');
$cashout = number_format($displayCashout, 2, '.', '');
Log::add('balance金额', $balance);
Log::add('cashout金额', $cashout);
}
if ($store_id) {
$storeObj = Store::where('id', $store_id)->first();
$store_name = $storeObj->title;
$phone = $storeObj->phone;
}
return $this->JsonResponse([
'user_id' => $muser->id,
'username' => $muser->username,
......
......@@ -54,30 +54,4 @@ public function autoChangeReceiveStatus()
return '--ok--';
}
//定时任务--订单分佣
public function autoOrderCommission()
{
$chunkSize = 50; // 每次处理的订单数量
$orders = OrderInfoModel::where(["order_status" => 4, 'is_commission' => 1])->orderBy('id')->take($chunkSize);
while ($orders->count() > 0) {
$orders->chunk($chunkSize, function ($batch) {
foreach ($batch as $order) {
//佣金分配
$res = OrderDivideRecord::divide($order->id);
if ($res) {
$order->is_commission = 2;
$order->save();
}
}
});
// 移动游标到下一批
$orders->skip($chunkSize);
$orders = $orders->getQuery();
sleep(3);
}
return '--ok--';
}
}
......@@ -3,6 +3,7 @@
namespace App\Http\Controllers\Api;
use App\Command\Log;
use App\Command\Tools; // 引入 Tools 类
use App\Handlers\FileUploadHandler;
use App\Models\Carousel;
use App\Models\GoodSku;
......@@ -50,7 +51,7 @@ public function addShoppingCart(Request $request)
Log::add('添加购物车商品规格', $goodsAttrObj->toArray());
$attr_id = $goodsAttrObj->id;
$attr_txt = $goodsAttrObj->attr_val;
$goods_price = $merchant_id ? $goodsAttrObj->cg_price : $goodsAttrObj->market_price;
$goods_price = ($merchant_id && $goodsObj->goods_type) ? $goodsAttrObj->cg_price : $goodsAttrObj->market_price;
}
$shoppingCart = isset($userObj->shopping_cart) ? json_decode($userObj->shopping_cart, true) : [];
......@@ -166,9 +167,24 @@ public function numberShoppingCart(Request $request)
public function info(Request $request)
{
$user = $request->user();
$balance = $user->balance ?? 0; //余额
$total_revenue = $user->total_revenue ?? 0; //总金额
$cashout = $total_revenue - $balance; //已提现
$merchant_id = $user->merchant_id ?? 0;
$total_revenue = $user->total_revenue ?? 0; // 总金额
$merObj = Merchant::where('id', $merchant_id)->first();
$balanceValue = $merObj->balance ?? 0;
$user_id = $user->id ?? 0;
// 使用 Tools 类计算 T+1 未到账金额
$pendingCashout = Tools::calculatePendingCashout($user_id);
// 调整金额计算公式
$displayBalance = $balanceValue + $pendingCashout;
$displayCashout = $total_revenue - $displayBalance;
$balance = number_format($displayBalance, 2, '.', '');// 余额
$cashout = number_format($displayCashout, 2, '.', '');// 已提现
return $this->JsonResponse([
'user_id' => $user->id,
'nickname' => $user->name,
......@@ -176,11 +192,11 @@ public function info(Request $request)
'phone' => $user->phone,
'phone_sec' => $user->phone ? substr($user->phone, 0, 3) . "****" . substr($user->phone, 7) : '',
//'status' => $user->status,
'merchant_id' => $user->merchant_id ?? 0,
'merchant_id' => $merchant_id,
'buycode' => $user->buycode ?? '',
'balance' => $balance ?? 0,
'total_revenue' => $total_revenue ?? 0,
'cashout' => $cashout ?? 0,
'cashout' => $cashout ?? 0
]);
}
......@@ -374,6 +390,9 @@ public function share(Request $request)
$userObj = $request->user();
$user_time = strtotime($userObj->created_at);
//用户注册时间大于分享人注册时间 才可以分享
Log::add('share','分享人注册时间:'. $sp_time .';当前用户注册时间:'. $user_time,$request);
if ($user_time > $sp_time) {
$user_id = $userObj->id;
$spuid = $userObj->spuid; //是否已有推荐人
......
......@@ -21,6 +21,7 @@ class Kernel extends HttpKernel
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\RequestLoggingMiddleware::class, // 添加这一行
];
/**
......
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use App\Command\Log; // 引入自定义日志类
class RequestLoggingMiddleware
{
/**
* 定义需要过滤的接口路径数组
* @var array
*/
private $filteredRoutes = [
'auto-to-commentstatus',
'simulate-login'
];
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
// 检查请求的路径是否在过滤列表中
foreach ($this->filteredRoutes as $route) {
if ($request->is($route)) {
return $next($request);
}
}
if (env('LOG_REQUESTS', false)) {
// 记录请求信息
$requestData = [
'method' => $request->method(),
'url' => $request->fullUrl(),
'headers' => $request->headers->all(),
'body' => $request->all(),
];
// 截取请求参数值,每个最多 5000 字符
$requestData = $this->truncateData($requestData);
Log::add('请求参数', $requestData, $request); // 使用自定义日志类记录请求日志
// 继续处理请求
$response = $next($request);
// 记录响应信息
$responseData = [
'status' => $response->getStatusCode(),
'headers' => $response->headers->all(),
'body' => $response->getContent(),
];
// 截取响应参数值,每个最多 5000 字符
$responseData = $this->truncateData($responseData);
Log::add('响应', $responseData, $request); // 使用自定义日志类记录响应日志
return $response;
}
return $next($request);
}
/**
* 截取数据中的字符串值,每个最多 5000 字符
*
* @param array $data
* @return array
*/
private function truncateData(array $data)
{
foreach ($data as $key => $value) {
if (is_string($value)) {
$data[$key] = mb_substr($value, 0, 5000);
} elseif (is_array($value)) {
$data[$key] = $this->truncateData($value);
}
}
return $data;
}
}
......@@ -47,8 +47,7 @@ public function handle()
$this->order->order_status = 4; //已完成
$this->order->save();
//佣金分配
OrderDivideRecord::divide($this->order->id);
DB::commit();
Log::add('订单自动完成', $this->order->toArray());
......
<?php
namespace App\Jobs;
use App\Command\Log;
use App\Models\OrderDivideRecord;
use App\Models\OrderInfo;
use App\Models\PaymentRecord;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;
use Exception;
class AutoOrderDivide implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $um_id; //推广人员ID
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($um_id, $delay)
{
$this->um_id = $um_id;
// 设置延迟的时间,delay() 方法的参数代表多少秒之后执行
$this->delay($delay);
}
/**
* * 定义这个任务类具体的执行逻辑
* 当队列处理器从队列中取出任务时,会调用 handle() 方法
* Execute the job.
*
* @return void
*/
public function handle()
{
$payment_confirm = new \NwVVVS\AdapaySdk\PaymentConfirm(); //支付确认
$spObj = User::find($this->um_id);
$member_id = $spObj->member_id;
$chunkSize = 10; // 每次处理数量
$orders = OrderDivideRecord::where(['um_id' => $this->um_id, 'is_div' => 0])->whereIn('sh_type', [1, 2])->orderBy('id')->take($chunkSize);
while ($orders->count() > 0) {
$orders->chunk($chunkSize, function ($batch) use ($member_id, $payment_confirm) {
foreach ($batch as $item) {
//交易记录
$order_sn = OrderInfo::where('id', $item->order_id)->value('order_sn');
$prObj = PaymentRecord::where('order_sn', $order_sn)->first();
# 支付确认参数设置
$payment_params = array(
"payment_id" => $prObj->payment_id,
"order_no" => 'payconfirm_' . date("YmdHis") . rand(100000, 999999),
"confirm_amt" => $item->divide_price,
"description" => "",
"div_members" => "" //分账参数列表 默认是数组List
);
// 分账列表
$payment_params['div_members'] = [
'member_id' => $member_id,
'amount' => $item->divide_price,
'fee_flag' => 'N'
];
# 发起支付确认创建
$payment_confirm->create($payment_params);
# 对支付确认创建结果进行处理
if ($payment_confirm->isError()) {
//失败处理
Log::add('用户绑卡,支付确认失败', $payment_confirm->result);
$result = $payment_confirm->result;
//throw new Exception($result['error_msg']);
} else {
//成功处理
Log::add('支付确认成功', $payment_confirm->result);
$result = $payment_confirm->result;
if ($result['status'] == 'succeeded') {
$item->is_div = 1;
$item->payconfirm_no = $result['order_no'];
$item->save();
Log::add('分账成功', ['order_sn' => $order_sn, 'member_id' => $member_id]);
}
}
}
});
// 移动游标到下一批
$orders->skip($chunkSize);
$orders = $orders->getQuery();
sleep(2);
}
}
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
class HfCompanyMember extends Model
{
use HasDateTimeFormatter;
use SoftDeletes;
protected $table = 'hf_company_member';
//添加企业用户
public function addCompanyMember($member_params)
{
$member = new \NwVVVS\AdapaySdk\CorpMember();
# 创建企业用户
$member->create($member_params);
# 对创建企业用户结果进行处理
if ($member->isError()) {
//失败处理
echo "<pre>";
print_r($member->result);
} else {
//成功处理
echo "<pre>";
print_r($member->result);
}
}
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
class HfPayconfirm extends Model
{
use HasDateTimeFormatter;
use SoftDeletes;
protected $table = 'hf_payconfirm';
public function add($params, $fee_amt)
{
$confirmObj = new self();
$confirmObj->payment_id = $params['payment_id'];
$confirmObj->order_no = $params['order_no'];
$confirmObj->confirm_amt = $params['confirm_amt'];
$confirmObj->fee_amt = $fee_amt;
$confirmObj->save();
return true;
}
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class HfProvAreaCode extends Model
{
use HasDateTimeFormatter;
protected $table = 'hf_prov_area_code';
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
class HfSettleAccount extends Model
{
use HasDateTimeFormatter;
use SoftDeletes;
protected $table = 'hf_settle_account';
}
......@@ -20,70 +20,165 @@ class OrderDivideRecord extends Model
];
//收益分配
public static function divide($order_id)
/**
* 收益分配
* order_id 订单ID
* payconfirm_no 发起确认支付,订单流水号
*/
public static function divide($order_id, $payconfirm_no = '')
{
$div_members = []; //汇付 分账对象
$orderObj = OrderInfo::find($order_id);
$merchant_id = $orderObj->merchant_id; //绑定的商户
$user_id = $orderObj->user_id; //下单用户ID
$userObj = User::find($user_id);
$buyer_id = $orderObj->user_id; //下单用户ID
$userObj = User::find($buyer_id);
$spuid = $userObj->spuid; //直推分享人
$second_spuid = $userObj->second_spuid; //间推分享人
$total_amount = 0; //订单商品总价
$first_proportion = $second_proportion = $merchant_proportion = ''; //佣金比例
$sp_ogid = ''; //参与分佣商品ID
$commissionPreData = [
'first_member_id' => '',
'first_amount' => 0,
'second_member_id' => '',
'second_amount' => 0,
'merchant_member_id' => '',
'merchant_amount' => 0,
];
//直推是否实名
$isFirstRealName = 0;
if ($spuid) {
$isFirstRealName = HfSettleAccount::where(['member_type' => 0, 'mid' => $spuid])->count();
}
//间推是否实名
$isSecondRealName = 0;
if ($second_spuid) {
$isSecondRealName = HfSettleAccount::where(['member_type' => 0, 'mid' => $second_spuid])->count();
}
//商户是否实名
$isMerchantRealName = 0;
if ($merchant_id) {
$hfCompanyMObj = HfCompanyMember::where('merchant_id', $merchant_id)->first();
$isMerchantRealName = ($hfCompanyMObj->status == 'succeeded') ? 1 : 0;
}
$ogList = OrderGoods::where("order_id", $order_id)->get(); //订单商品
foreach ($ogList as $kk => $item) {
$goods_amount = $item->goods_price * $item->goods_number;
$total_amount += $goods_amount;
//商品信息
$goodObj = Good::find($item->goods_id);
$merchant_commission = $goodObj->merchant_commission;
$first_commission = $goodObj->first_commission;
$second_commission = $goodObj->second_commission;
$first_proportion .= $goodObj->first_commission . ",";
$second_proportion .= $goodObj->second_commission . ",";
$merchant_proportion .= $goodObj->merchant_commission . ",";
$sp_ogid = $item->id . ",";
//直推佣金
if ($spuid && $first_commission >= 1 && $first_commission < 100) {
$divide_price = number_format($goods_amount * ($first_commission / 100), 2);
//收益直接到直推账户
$spObj = User::find($spuid);
$spObj->total_revenue += $divide_price;
$spObj->balance += $divide_price;
$spObj->save();
self::addRecord($item->id, $order_id, $goods_amount, $divide_price, $first_commission, $spuid, $user_id, 1);
//汇付参数
if ($spObj->member_id) {
$spObj->total_revenue += $divide_price; //总余额记录
$spObj->save();
//self::addRecord($item->id, $order_id, $goods_amount, $divide_price, $first_commission, $spuid, $user_id, 1, $isExistAccount);
$commissionPreData['first_member_id'] = $spObj->member_id;
$commissionPreData['first_amount'] += $divide_price;
}
}
//间推佣金
if ($second_spuid && $second_commission >= 1 && $second_commission < 100) {
$divide_price = number_format($goods_amount * ($second_commission / 100), 2);
//收益直接到直推账户
$spObj = User::find($second_spuid);
$spObj->total_revenue += $divide_price;
$spObj->balance += $divide_price;
$spObj->save();
self::addRecord($item->id, $order_id, $goods_amount, $divide_price, $second_commission, $second_spuid, $user_id, 2);
//汇付参数
if ($spObj->member_id) {
$spObj->total_revenue += $divide_price;
$spObj->save();
$commissionPreData['second_member_id'] = $spObj->member_id;
$commissionPreData['second_amount'] += $divide_price;
}
}
//商户分佣记录
if ($merchant_id && $merchant_commission >= 1 && $merchant_commission < 100) {
$divide_price = number_format($goods_amount * ($merchant_commission / 100), 2);
//收益直接到商户账户
$merObj = Merchant::find($merchant_id);
$merObj->total_revenue += $divide_price;
$merObj->balance += $divide_price;
$merObj->save();
//记录
self::addRecord($item->id, $order_id, $goods_amount, $divide_price, $merchant_commission, $merchant_id, $user_id, 3);
//汇付参数
$member_id = $hfCompanyMObj->member_id;
if ($member_id) {
$merObj->total_revenue += $divide_price;
$merObj->save();
$commissionPreData['merchant_member_id'] = $member_id;
$commissionPreData['merchant_amount'] += $divide_price;
}
}
}
//组合分账参数
if ($spuid && $first_commission >= 1 && $first_commission < 100 && $commissionPreData['first_amount'] > 0) {
self::addRecord($sp_ogid, $order_id, $orderObj->goods_amount, $commissionPreData['first_amount'], $first_proportion, $spuid, $buyer_id, 1, $isFirstRealName, $payconfirm_no);
if ($isFirstRealName) {
array_push($div_members, ['member_id' => $commissionPreData['first_member_id'], 'amount' => sprintf("%.2f", $commissionPreData['first_amount']), 'fee_flag' => 'N']);
}
}
if ($second_spuid && $second_commission >= 1 && $second_commission < 100 && $commissionPreData['second_amount'] > 0) {
self::addRecord($sp_ogid, $order_id, $orderObj->goods_amount, $commissionPreData['second_amount'], $second_proportion, $second_spuid, $buyer_id, 2, $isSecondRealName, $payconfirm_no);
if ($isSecondRealName) {
array_push($div_members, ['member_id' => $commissionPreData['second_member_id'], 'amount' => sprintf("%.2f", $commissionPreData['second_amount']), 'fee_flag' => 'N']);
}
}
if ($merchant_id && $merchant_commission >= 1 && $merchant_commission < 100 && $commissionPreData['merchant_amount'] > 0) {
self::addRecord($sp_ogid, $order_id, $orderObj->goods_amount, $commissionPreData['merchant_amount'], $merchant_proportion, $merchant_id, $buyer_id, 3, $isMerchantRealName, $payconfirm_no);
if ($isMerchantRealName) {
array_push($div_members, ['member_id' => $commissionPreData['merchant_member_id'], 'amount' => sprintf("%.2f", $commissionPreData['merchant_amount']), 'fee_flag' => 'N']);
}
}
return true;
//商户本身
$aimeiyuePrice = $total_amount - $commissionPreData['first_amount'] - $commissionPreData['second_amount'] - $commissionPreData['merchant_amount'];
self::addRecord($sp_ogid, $order_id, $orderObj->goods_amount, $aimeiyuePrice, '', 0, $buyer_id, 0, 1, $payconfirm_no);
array_push($div_members, ['member_id' => 0, 'amount' => sprintf("%.2f", $aimeiyuePrice), 'fee_flag' => 'Y']);
//确认分佣金额
if (!$isFirstRealName) {
$commissionPreData['first_amount'] = 0;
}
if (!$isSecondRealName) {
$commissionPreData['second_amount'] = 0;
}
if (!$isMerchantRealName) {
$commissionPreData['merchant_amount'] = 0;
}
$confirm_amt = $aimeiyuePrice + $commissionPreData['first_amount'] + $commissionPreData['second_amount'] + $commissionPreData['merchant_amount'];
return ['div_members' => $div_members, 'confirm_amt' => sprintf("%.2f", $confirm_amt)];
}
public static function addRecord($og_id, $order_id, $goods_amount, $divide_price, $commission, $um_id, $user_id, $sh_type)
public static function addRecord($og_id, $order_id, $goods_amount, $divide_price, $commission = '', $um_id = 0, $buyer_id, $sh_type = 0, $isExistAccount, $payconfirm_no)
{
$recordObj = new self();
$recordObj->order_id = $order_id;
$recordObj->user_id = $user_id; //下单userId
$recordObj->og_id = $og_id;
$recordObj->user_id = $buyer_id;
$recordObj->og_id = trim($og_id, ',');
$recordObj->order_price = $goods_amount;
$recordObj->divide_price = $divide_price;
$recordObj->proportion = $commission;
$recordObj->proportion = trim($commission, ',');
$recordObj->um_id = $um_id;
$recordObj->sh_type = $sh_type;
$recordObj->is_div = $isExistAccount ? 1 : 0; //是否分账
$recordObj->payconfirm_no = $isExistAccount ? $payconfirm_no : '';
$recordObj->save();
Log::add('订单分佣记录', $recordObj->toArray());
}
public function order()
{
return $this->belongsTo(OrderInfo::class, 'order_id', 'id');
}
public function users()
{
return $this->belongsTo(User::class, 'user_id', 'id');
}
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class RefundRecord extends Model
{
use HasDateTimeFormatter;
protected $table = 'refund_record';
public function user()
{
return $this->belongsTo(User::class, 'uid');
}
}
......@@ -2,6 +2,8 @@
namespace App\Store\Controllers;
use App\Command\Log;
use App\Command\Tools; // 引入 Tools 类
use App\Models\Merchant;
use App\Models\OrderDivideRecord;
use Dcat\Admin\Admin;
......@@ -15,11 +17,6 @@
class OrderDivideRecordController extends AdminController
{
// public function index(Content $content)
// {
// return $content->header('自定义表单')->body($this->grid());
// }
/**
* Make a grid builder.
*
......@@ -33,8 +30,20 @@ protected function grid()
if ($merchant_id) {
$merObj = Merchant::where('id', $merchant_id)->first();
$total_revenue = $merObj->total_revenue ?? 0;
$balance = $merObj->balance ?? 0;
$cashout = $total_revenue - $balance;
$balanceValue = $merObj->balance ?? 0;
// 使用 Tools 类计算 T+1 未到账金额
$pendingCashout = Tools::calculatePendingCashout($merchant_id);
// 调整金额计算公式
$displayBalance = $balanceValue + $pendingCashout;
$displayCashout = $total_revenue - $displayBalance;
$balance = number_format($displayBalance, 2, '.', '');
$cashout = number_format($displayCashout, 2, '.', '');
Log::add('balance金额', $balance);
Log::add('cashout金额', $cashout);
}
$grid->header(function () use ($total_revenue, $balance, $cashout) {
$box = new Box('统计信息', '这里可以放置统计数据');
......
......@@ -23,6 +23,7 @@
"league/flysystem": "^3.29",
"lty5240/dcat-easy-sku": "^1.1",
"maatwebsite/excel": "~3.1.0",
"nwvvvs/adapay": "^1.4",
"overtrue/wechat": "~5.0",
"phpoffice/phpspreadsheet": "^1.29",
"predis/predis": "^2.1",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "1b40207476190f175adf99e702616055",
"content-hash": "85cce16723f4d5d65761cb74fb48b74e",
"packages": [
{
"name": "abbotton/dcat-sku-plus",
......@@ -4741,6 +4741,58 @@
"time": "2023-02-08T01:06:31+00:00"
},
{
"name": "nwvvvs/adapay",
"version": "1.4.4",
"source": {
"type": "git",
"url": "https://github.com/NmVVVS/adapay.git",
"reference": "e6aee8fb1c2b4efdc2113834d02e740d614eaf12"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/NmVVVS/adapay/zipball/e6aee8fb1c2b4efdc2113834d02e740d614eaf12",
"reference": "e6aee8fb1c2b4efdc2113834d02e740d614eaf12",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-curl": "*",
"ext-mbstring": "*",
"php": ">=8.0.0"
},
"type": "libaray",
"autoload": {
"psr-4": {
"NwVVVS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "NwVVVS",
"email": "xevckq@proton.me"
}
],
"description": "基于AdaPay官方PHP v1.4.4的composer包",
"keywords": [
"adapay",
"pay"
],
"support": {
"issues": "https://github.com/NmVVVS/adapay/issues",
"source": "https://github.com/NmVVVS/adapay/tree/1.4.4"
},
"time": "2024-06-17T11:26:49+00:00"
},
{
"name": "overtrue/socialite",
"version": "4.11.0",
"source": {
......
......@@ -200,7 +200,7 @@
|--------------------------------------------------------------------------
*/
'helpers' => [
'enable' => true,
'enable' => false,
],
/*
......
{
"*************DO NOT CHANGE CONTENT*************":"",
"api_key_live":"api_live_2d28000f-7207-4e48-a4a7-bb7f3605e6a2",
"api_key_test":"api_test_ecfac4aa-d54c-4551-88fc-8655bbf6cfe2",
"rsa_public_key":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwN6xgd6Ad8v2hIIsQVnbt8a3JituR8o4Tc3B5WlcFR55bz4OMqrG/356Ur3cPbc2Fe8ArNd/0gZbC9q56Eb16JTkVNA/fye4SXznWxdyBPR7+guuJZHc/VW2fKH2lfZ2P3Tt0QkKZZoawYOGSMdIvO+WqK44updyax0ikK6JlNQIDAQAB",
"*************DO NOT CHANGE CONTENT*************":"",
"rsa_private_key":"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALESBPCpBbsMAgcLaonh7Tj3br/5MkH7Re7r5CsZueuu4V98NZYY9aBu98kOWNcBbiiVoqb39JPnaKd+WElQNOWSqyN3VqAzOqXSw76kCfDgIGUkBIzmbC6A0v/85qdxXRIThnIc0adCjDxVmp8HNiK3Bwxm1mbES+x93D2b7XkbAgMBAAECgYEApyhHmZk2W7meQGA6lye89kY/OuNY2okHH+F4aGfE6AUTpTxwqd2uI2IecKMmovIquA1qmw0Ayo9ucJAJcExTYcAprcAMMbDTtj/damatyYzxg+Sm2LlJz7h9RLvMk+juhhEeiDXoo/be3mx2i14jW1PCAt61Ylo/40lZwya8jKECQQD0OJbCMtQhDJjdlsW4P4FEVhkh9uHpVgm0Xnw9PktW5Vi+iiYdOIAqsTgS4F+053LcIaN0jwAYzsMG1mL1bP0fAkEAuZxRP3fWekQAZaCGTW0vQxhmO6QMRulieeBTP61Tjn/OHzlmJdQRXP7UFRdmLmmo24UBADbP6+oDkt/d2/sIhQJASStHJ8m4umoexozskgYcwY+WGhHwn0sSv0JrsKGgStmN3BBh2PFbnO7ZoPYuVnHdfMxrP3m0irovvjWvEl7j+wJALomzFWbGsAE82D5XbjJiF0CW4X1QVrdNqaFFPkIHIUOKOun5YqK5d8etBVzIkfqMC/5dMeCMYWpbWwgmaHGYwQJBAJDjug5UxO2mBKZ0++TWYPRY74jnN9sEDeFvS/xgTgvmzWcg1q0huuZq+kbYJaKWUZQEhw+EBnd8PCvzmLdR4pY="
}
\ No newline at end of file
<?php
return [
'labels' => [
'HfCompanyMember' => '企业用户',
'hf-company-member' => '企业用户',
],
'fields' => [
'order_no' => '请求订单号',
'cont_name' => '联系人姓名',
'cont_phone' => '联系人手机号',
'email' => 'Email',
'entry_mer_type' => '商户类型',
'social_credit_code' => '统一社会信用代码',
'name' => '企业名称',
'social_credit_code_begin' => '营业执照有效期起始日期',
'social_credit_code_expires' => '营业执照有效期截止日期',
'address' => '注册地址',
'business_scope' => '经营范围',
'legal_cert_type' => '法人证件类型',
'legal_cert_id' => '法人证件号码',
'legal_person' => '法人姓名',
'legal_cert_id_begin' => '法人证件有效期起始日期',
'legal_cert_id_expires' => '法人证件有效期截止日期',
'legal_mp' => '法人手机号',
'attach_file' => '附件',
],
'options' => [],
];
<?php
return [
'labels' => [
'OrderDivideRecord' => '余额明细',
'OrderDivideRecord' => '余额明细',
'OrderDivideRecord' => '分佣记录',
'OrderDivideRecord' => '分佣记录',
],
'fields' => [
'user_id' => '用户ID',
......
......@@ -21,12 +21,26 @@
Route::namespace('App\Http\Controllers\Api')->middleware('acceptJson')->group(function () {
Route::post('simulate-login','LoginController@simulateLogin'); //模拟登陆
Route::post('get-openid', 'LoginController@getOpenid'); //获取openid
Route::post('login', 'LoginController@login')->name('login'); //用户端授权登录
Route::get('test-login', 'LoginController@testLogin'); //测试登录
Route::get('city-code', 'BaseController@addCityCode'); //导入城市编码(汇付)
Route::post('hf-company-member-notify', 'HfCompanyMemberController@notify'); //汇付 创建企业用户异步通知
Route::get('hf-bank-code', 'HfSettleAccountController@getBankCode'); //汇付 银行代码
Route::get('hf-provarea-code', 'HfProvAreaCodeController@getList'); //汇付 省市编码
Route::get('hf-query-list', 'HfOrderController@autoQueryList'); //汇付 定时查询支付对象列表
Route::post('hf-payment-confirm', 'HfOrderController@paymentConfirm'); //汇付 手动创建支付确认
//Route::post('mobile-login', 'LoginController@mobilelogin'); //验证码登录
Route::post('account-login', 'StoreAdminUsersController@login'); //账号密码登录
......@@ -43,7 +57,7 @@
Route::get('get-cate-list', 'CategoryController@getList'); //一级分类列表
Route::post('article-list', 'ArticleController@getList'); //文章列表
Route::get('article-list', 'ArticleController@getList'); //文章列表
Route::get('article-detail', 'ArticleController@getDetail'); //文章详情
// Route::get('get-seccate-list', 'CategoryController@getSecList'); //二级分类列表
......@@ -72,6 +86,8 @@
Route::any('pay-notify', 'OrderController@payNotify'); //付款回调
Route::any('refund-notify', 'HfOrderController@refundNotify'); //退款回调
Route::get('send/config/update', 'SystemController@update');
Route::get('auto-to-commentstatus', 'SystemController@autoChangeReceiveStatus'); //定时任务--待领取状态下七天未领取,自动到待评价状态
......@@ -160,6 +176,8 @@
Route::post('add-comment', 'CommentController@add'); //去评价
/*------------------------------商户端------------------------------------*/
Route::get('commission-list', 'OrderDivideRecordController@getList'); //直推、间推明细
Route::get('income-list', 'IncomeController@getList'); //用户提现明细
......@@ -168,10 +186,27 @@
Route::get('my-member', 'MerchantController@getUserList'); //商户端-我的用户
Route::post('my-member-orderlist', 'MerchantController@getOrderList'); //商户端-我的用户(查看订单)
Route::post('scan-code-detail', 'OrderController@scanCodeDetail'); //扫码核销展示详情
Route::post('scan-code-verifi', 'OrderController@scanCodeVerifi'); //扫码核销确认
Route::get('merchant-order-collect', 'OrderController@orderCollect'); //商户端首页统计
/*------------------------------汇付天下------------------------------------*/
Route::post('hf-settle-account-delete', 'HfSettleAccountController@deleteAccount'); //汇付 删除结算账户
Route::post('hf-settle-account-member', 'HfSettleAccountController@createMemberAccount'); //汇付 创建普通用户结算账户
Route::post('hf-settle-account-company', 'HfSettleAccountController@createCompanyAccount'); //汇付 创建企业用户结算账户
Route::get('hf-mycard', 'HfSettleAccountController@myCard'); //查询已绑定结算账户
Route::post('hf-settle-account-query', 'HfSettleAccountController@queryAccount'); //汇付 查询用户结算账户
Route::get('hf-account-balance', 'HfSettleAccountController@queryBalance'); //汇付 查询账户余额
});
});
*
!public/
!.gitignore
compiled.php
config.php
down
events.scanned.php
maintenance.php
routes.php
routes.scanned.php
schedule-*
services.json
a:5:{s:6:"_token";s:40:"HlN5DetQedvaf6nRkif0iUWRmUn4j4pTeIzIYhaL";s:9:"_previous";a:1:{s:3:"url";s:83:"http://aimeiyue.demo.cn/category-download?date=2025-03-22&s=%2F%2Fcategory-download";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}s:52:"login_admin_59ba36addc2b2f9401580f014c7f58ea4e30989d";i:1;s:5:"admin";a:1:{s:4:"prev";a:0:{}}}
\ No newline at end of file
<style>::-ms-clear,::-ms-reveal{display: none;}</style>
<form pjax-container action="<?php echo $action; ?>" class="input-no-border quick-search-form d-md-inline-block" style="display:none;margin-right: 16px">
<div class="table-filter">
<label style="width: <?php echo e($width, false); ?>rem">
<input
type="search"
class="form-control form-control-sm quick-search-input"
placeholder="<?php echo e($placeholder, false); ?>"
name="<?php echo e($key, false); ?>"
value="<?php echo e($value, false); ?>"
auto="<?php echo e($auto ? '1' : '0', false); ?>"
>
</label>
</div>
</form>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/quick-search.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="input-group input-group-sm quick-form-field">
<select class="form-control <?php echo e($class, false); ?>" style="width: 100%;" name="<?php echo e($name, false); ?>" <?php echo $attributes; ?> >
<option value=""></option>
<?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $select => $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($select, false); ?>" <?php echo e(Dcat\Admin\Support\Helper::equal($select, old($column, $value)) ?'selected':'', false); ?>><?php echo e($option, false); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<?php echo $__env->make('admin::form.select-script', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/quick-create/select.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if(isset($errors) && $errors->hasBag('exception')): ?>
<?php $error = $errors->getBag('exception'); ?>
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4>
<i class="icon fa fa-warning"></i>
<i style="border-bottom: 1px dotted #fff;cursor: pointer;" title="<?php echo e($error->get('type')[0], false); ?>" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;"><?php echo e(class_basename($error->get('type')[0]), false); ?></i>
In <i title="<?php echo e($error->get('file')[0], false); ?> line <?php echo e($error->get('line')[0], false); ?>" style="border-bottom: 1px dotted #fff;cursor: pointer;" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;"><?php echo e(basename($error->get('file')[0]), false); ?> line <?php echo e($error->get('line')[0], false); ?></i> :
</h4>
<p><a style="cursor: pointer;" onclick="$('#dcat-admin-exception-trace').toggleClass('hidden');$('i', this).toggleClass('fa-angle-double-down fa-angle-double-up');"><i class="fa fa-angle-double-down"></i>&nbsp;&nbsp;<?php echo $error->first('message'); ?></a></p>
<p class="hidden" id="dcat-admin-exception-trace"><br><?php echo nl2br($error->first('trace')); ?></p>
</div>
<?php endif; ?>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/partials/exception.blade.php ENDPATH**/ ?>
\ No newline at end of file
<span class="dropdown column-selector" >
<button class="btn btn-primary btn-outline dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-table"></i>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" style="min-width: 155px">
<li class="dropdown-item">
<ul class="selectors">
<?php echo $selectAll; ?>
</ul>
</li>
<li class="dropdown-divider"></li>
<li class="dropdown-item">
<ul class="selectors">
<?php echo $checkbox; ?>
</ul>
</li>
</ul>
</span>
<script once>
$('.column-selector input[name="_all_"]').on('change', function () {
$(this).parents('.column-selector').find('.column-select-item').prop('checked', this.checked).change()
});
var submit = Dcat.helpers.debounce(function ($this) {
var defaults = <?php echo json_encode($defaults); ?>;
var selected = [];
var $parent = $this.parents('.column-selector');
var column = '<?php echo e($columnName, false); ?>'
$parent.find('.column-select-item:checked').each(function () {
selected.push($(this).val());
});
if (selected.length == 0) {
return;
}
var url = new URL(location);
if (selected.sort().toString() == defaults.sort().toString()) {
url.searchParams.set(column, '');
} else {
url.searchParams.set(column, selected.join());
}
Dcat.reload(url.toString());
}, 200);
$('.column-selector .column-select-item').on('change', function () {
submit($(this));
});
</script>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/column-selector.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="d-flex">
<?php if($row->logo): ?>
<img data-action='preview-img' src='<?php echo $row->logo; ?>' style='max-width:40px;max-height:40px;cursor:pointer' class='img img-thumbnail' />&nbsp;&nbsp;
<?php endif; ?>
<span class="ext-name">
<?php if($row->homepage): ?>
<a href='<?php echo $row->homepage; ?>' target='_blank' class="feather <?php echo e($linkIcon, false); ?>"></a>
<?php endif; ?>
<?php if($row->alias): ?>
<?php echo e($row->alias, false); ?> <br><small class="text-80"><?php echo e($value, false); ?></small>
<?php else: ?>
<?php echo e($value, false); ?>
<?php endif; ?>
</span>
<?php if($row->new_version || ! $row->version): ?>
&nbsp;
<span class="badge bg-primary">New</span>
<?php endif; ?>
</div>
<div style="height: 10px"></div>
<?php if($row->type === Dcat\Admin\Extend\ServiceProvider::TYPE_THEME): ?>
<span><?php echo e(trans('admin.theme'), false); ?></span>
<?php endif; ?>
<?php if($row->version): ?>
<?php if($row->type === Dcat\Admin\Extend\ServiceProvider::TYPE_THEME): ?>
&nbsp;|&nbsp;
<?php endif; ?>
<?php if($row->enabled): ?>
<?php echo $disableAction; ?>
<?php else: ?>
<?php echo $enableAction; ?>
<?php endif; ?>
<span class="hover-display" onclick="$(this).css({display: 'inline'})">
| <?php echo $uninstallAction; ?>
</span>
<?php endif; ?>
<style>
.badge {
max-height: 22px
}
.hover-display {
display:none;
}
table tbody tr:hover .hover-display {
display: inline;
}
.ext-name {
font-size: 1.15rem;
}
</style>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/displayer/extensions/name.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if($inline): ?>
<div class="d-flex flex-wrap">
<?php endif; ?>
<?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="vs-checkbox-con vs-checkbox-<?php echo e($style, false); ?>" style="margin-right: <?php echo e($right, false); ?>">
<input <?php echo in_array($k, $disabled) ? 'disabled' : ''; ?> value="<?php echo e($k, false); ?>" <?php echo $attributes; ?> <?php echo (in_array($k, $checked)) ? 'checked' : ''; ?>>
<span class="vs-checkbox vs-checkbox-<?php echo e($size, false); ?>">
<span class="vs-checkbox--check">
<i class="vs-icon feather icon-check"></i>
</span>
</span>
<?php if($label !== null && $label !== ''): ?>
<span><?php echo $label; ?></span>
<?php endif; ?>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($inline): ?>
</div>
<?php endif; ?><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/widgets/checkbox.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if($showHeader): ?>
<div class="box-header with-border mb-1" style="padding: .65rem 1rem">
<h3 class="box-title" style="line-height:30px"><?php echo $form->title(); ?></h3>
<div class="pull-right"><?php echo $form->renderTools(); ?></div>
</div>
<?php endif; ?>
<div class="box-body" <?php echo $tabObj->isEmpty() && !$form->hasRows() ? 'style="margin-top: 6px"' : ''; ?> >
<?php if(!$tabObj->isEmpty()): ?>
<?php echo $__env->make('admin::form.tab', compact('tabObj', 'form'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php else: ?>
<div class="fields-group">
<?php echo $__env->make('admin::form.fields', ['rows' => $form->rows(), 'fields' => $form->fields(), 'layout' => $form->layout()], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
<?php endif; ?>
</div>
<?php echo $form->renderFooter(); ?>
<?php echo $form->renderHiddenFields(); ?>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/form/container.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div <?php echo $attributes; ?>>
<div class="card-header d-flex justify-content-between align-items-start pb-0">
<div>
<?php if($icon): ?>
<div class="avatar bg-rgba-<?php echo e($style, false); ?> p-50 m-0">
<div class="avatar-content">
<i class="<?php echo e($icon, false); ?> text-<?php echo e($style, false); ?> font-medium-5"></i>
</div>
</div>
<?php endif; ?>
<?php if($title): ?>
<h4 class="card-title mb-1"><?php echo $title; ?></h4>
<?php endif; ?>
<div class="metric-header"><?php echo $header; ?></div>
</div>
<?php if(! empty($subTitle)): ?>
<span class="btn btn-sm bg-light shadow-0 p-0">
<?php echo e($subTitle, false); ?>
</span>
<?php endif; ?>
<?php if(! empty($dropdown)): ?>
<div class="dropdown chart-dropdown">
<button class="btn btn-sm btn-light shadow-0 dropdown-toggle p-0 waves-effect" data-toggle="dropdown">
<?php echo e(current($dropdown), false); ?>
</button>
<div class="dropdown-menu dropdown-menu-right">
<?php $__currentLoopData = $dropdown; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li class="dropdown-item"><a href="javascript:void(0)" class="select-option" data-option="<?php echo e($key, false); ?>"><?php echo e($value, false); ?></a></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<?php endif; ?>
<?php if(! empty($datepicker)): ?>
<div class="col-md-9 datepicker">
<div class="row">
<div class="col-lg-5 pl-0">
<div class="input-group">
<span class="input-group-prepend">
<span class="input-group-text bg-white"><i class="feather icon-calendar"></i></span>
</span>
<input autocomplete="off" type="text" name="started" value="<?php echo e($datepicker['start'], false); ?>" class="form-control field_started" required="1" id="asdsss">
</div>
</div>
<div class="col-lg-5 pl-0">
<div class="input-group">
<span class="input-group-prepend">
<span class="input-group-text bg-white"><i class="feather icon-calendar"></i></span>
</span>
<input autocomplete="off" type="text" name="ended" value="<?php echo e($datepicker['end'], false); ?>" class="form-control field_ended" required="1" id="_35455a066a22a942">
</div>
</div>
<div class="col-lg-2 pl-0 pr-0">
<button class="btn btn-primary btn-outline-info" data-started="<?php echo e($datepicker['start'], false); ?>" data-ended="<?php echo e($datepicker['end'], false); ?>">
<span class="d-none d-sm-inline">查询</span>
</button>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="metric-content"><?php echo $content; ?></div>
</div><?php /**PATH D:\work\PHP\aimeiyue\all\service\resources\views/widgets/metrics/card.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="input-group input-group-sm quick-form-field">
<input <?php echo $attributes; ?> placeholder="<?php echo e($label, false); ?>"/>
</div><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/quick-create/text.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="<?php echo e($configData['horizontal_menu'] ? 'header-navbar navbar-expand-sm navbar navbar-horizontal' : 'main-menu', false); ?>">
<div class="main-menu-content">
<aside class="<?php echo e($configData['horizontal_menu'] ? 'main-horizontal-sidebar' : 'main-sidebar shadow', false); ?> <?php echo e($configData['sidebar_style'], false); ?>">
<?php if(! $configData['horizontal_menu']): ?>
<div class="navbar-header">
<ul class="nav navbar-nav flex-row">
<li class="nav-item mr-auto">
<a href="<?php echo e(admin_url('/'), false); ?>" class="navbar-brand waves-effect waves-light">
<span class="logo-mini"><?php echo config('admin.logo-mini'); ?></span>
<span class="logo-lg"><?php echo config('admin.logo'); ?></span>
</a>
</li>
</ul>
</div>
<?php endif; ?>
<div class="p-0 <?php echo e($configData['horizontal_menu'] ? 'pl-1 pr-1' : 'sidebar pb-3', false); ?>">
<ul class="nav nav-pills nav-sidebar <?php echo e($configData['horizontal_menu'] ? '' : 'flex-column', false); ?>"
<?php echo $configData['horizontal_menu'] ? '' : 'data-widget="treeview"'; ?>
style="padding-top: 10px">
<?php echo admin_section(Dcat\Admin\Admin::SECTION['LEFT_SIDEBAR_MENU_TOP']); ?>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['LEFT_SIDEBAR_MENU']); ?>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['LEFT_SIDEBAR_MENU_BOTTOM']); ?>
</ul>
</div>
</aside>
</div>
</div><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/partials/sidebar.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if($rows): ?>
<div class="ml-2 mb-2 mr-2" style="margin-top: -0.5rem">
<?php $__currentLoopData = $rows; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo $row->render(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php $__currentLoopData = $fields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($field instanceof Dcat\Admin\Form\Field\Hidden): ?>
<?php echo $field->render(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<?php elseif($layout->hasColumns()): ?>
<?php echo $layout->build(); ?>
<?php else: ?>
<?php $__currentLoopData = $fields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo $field->render(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/form/fields.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if($grid->allowToolbar()): ?>
<div class="custom-data-table-header">
<div class="table-responsive">
<div class="top d-block clearfix p-0">
<?php if(!empty($title)): ?>
<h4 class="pull-left" style="margin:5px 10px 0;">
<?php echo $title; ?>&nbsp;
<?php if(!empty($description)): ?>
<small><?php echo $description; ?></small>
<?php endif; ?>
</h4>
<div class="pull-right" data-responsive-table-toolbar="<?php echo e($tableId, false); ?>">
<?php echo $grid->renderTools(); ?>
<?php echo $grid->renderColumnSelector(); ?>
<?php echo $grid->renderCreateButton(); ?>
<?php echo $grid->renderExportButton(); ?>
<?php echo $grid->renderQuickSearch(); ?>
</div>
<?php else: ?>
<?php echo $grid->renderTools(); ?> <?php echo $grid->renderQuickSearch(); ?>
<div class="pull-right" data-responsive-table-toolbar="<?php echo e($tableId, false); ?>">
<?php echo $grid->renderColumnSelector(); ?>
<?php echo $grid->renderCreateButton(); ?>
<?php echo $grid->renderExportButton(); ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/table-toolbar.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="filter-input col-sm-<?php echo e($width, false); ?> " style="<?php echo $style; ?>">
<div class="form-group"><?php echo $presenter(); ?></div>
</div><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/filter/where.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if(! $isHoldSelectAllCheckbox): ?>
<div class="btn-group dropdown <?php echo e($selectAllName, false); ?>-btn" style="display:none;margin-right: 3px;z-index: 100">
<button type="button" class="btn btn-white dropdown-toggle btn-mini" data-toggle="dropdown">
<span class="d-none d-sm-inline selected"></span>
<span class="caret"></span>
<span class="sr-only"></span>
</button>
<ul class="dropdown-menu" role="menu">
<?php $__currentLoopData = $actions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $action): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($action instanceof Dcat\Admin\Grid\Tools\ActionDivider): ?>
<li class="dropdown-divider"></li>
<?php else: ?>
<li class="dropdown-item">
<?php echo $action->render(); ?>
</li>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
</div>
<?php endif; ?>
<script>
Dcat.init('.<?php echo e($parent->getRowName(), false); ?>-checkbox', function ($this) {
$this.on('change', function () {
var btn = $('.<?php echo e($selectAllName, false); ?>-btn'), selected = Dcat.grid.selectedRows('<?php echo e($parent->getName(), false); ?>').length;
if (selected) {
btn.show()
} else {
btn.hide()
}
setTimeout(function () {
btn.find('.selected').html("<?php echo trans('admin.grid_items_selected'); ?>".replace('{n}', selected));
}, 50)
})
})
</script>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/batch-actions.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php echo admin_section(Dcat\Admin\Admin::SECTION['NAVBAR_BEFORE']); ?>
<nav class="header-navbar navbar-expand-lg navbar
navbar-with-menu <?php echo e($configData['navbar_class'], false); ?>
<?php echo e($configData['navbar_color'], false); ?>
navbar-light navbar-shadow " style="top: 0;">
<div class="navbar-wrapper">
<div class="navbar-container content">
<?php if(! $configData['horizontal_menu']): ?>
<div class="mr-auto float-left bookmark-wrapper d-flex align-items-center">
<ul class="nav navbar-nav">
<li class="nav-item mr-auto">
<a class="nav-link menu-toggle" data-widget="pushmenu" style="cursor: pointer;">
<i class="fa fa-bars font-md-2"></i>
</a>
</li>
</ul>
</div>
<?php endif; ?>
<div class="navbar-collapse d-flex justify-content-between">
<div class="navbar-left d-flex align-items-center">
<?php echo Dcat\Admin\Admin::navbar()->render('left'); ?>
</div>
<?php if($configData['horizontal_menu']): ?>
<div class="d-md-block horizontal-navbar-brand justify-content-center text-center">
<ul class="nav navbar-nav flex-row">
<li class="nav-item mr-auto">
<a href="<?php echo e(admin_url('/'), false); ?>" class="waves-effect waves-light">
<span class="logo-lg"><?php echo config('admin.logo'); ?></span>
</a>
</li>
</ul>
</div>
<?php endif; ?>
<div class="navbar-right d-flex align-items-center">
<?php echo Dcat\Admin\Admin::navbar()->render(); ?>
<ul class="nav navbar-nav">
<?php echo admin_section(Dcat\Admin\Admin::SECTION['NAVBAR_USER_PANEL']); ?>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['NAVBAR_AFTER_USER_PANEL']); ?>
</ul>
</div>
</div>
</div>
</div>
</nav>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['NAVBAR_AFTER']); ?><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/partials/navbar.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if(Session::has('dcat-admin-toastr')): ?>
<?php
$toastr = Session::get('dcat-admin-toastr');
$type = $toastr->get('type')[0] ?? 'success';
$message = $toastr->get('message')[0] ?? '';
$options = admin_javascript_json($toastr->get('options', []));
?>
<script>$(function () { toastr.<?php echo e($type, false); ?>('<?php echo $message; ?>', null, <?php echo $options; ?>); })</script>
<?php endif; ?><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/partials/toastr.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="<?php echo e($viewClass['form-group'], false); ?>" style="margin-top: .3rem">
<label class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo $label; ?></label>
<div class="<?php echo e($viewClass['field'], false); ?>">
<div class="box box-solid box-default no-margin">
<div class="box-body">
<div class="<?php echo e($class, false); ?>"><?php echo $value; ?>&nbsp;</div>
</div>
</div>
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/form/display.blade.php ENDPATH**/ ?>
\ No newline at end of file
<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale()), false); ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title><?php if(! empty($header)): ?><?php echo e($header, false); ?> | <?php endif; ?> <?php echo e(Dcat\Admin\Admin::title(), false); ?></title>
<?php if(! config('admin.disable_no_referrer_meta')): ?>
<meta name="referrer" content="no-referrer"/>
<?php endif; ?>
<?php if(! empty($favicon = Dcat\Admin\Admin::favicon())): ?>
<link rel="shortcut icon" href="<?php echo e($favicon, false); ?>">
<?php endif; ?>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['HEAD']); ?>
<?php echo Dcat\Admin\Admin::asset()->headerJsToHtml(); ?>
<?php echo Dcat\Admin\Admin::asset()->cssToHtml(); ?>
</head>
<?php echo $__env->make('admin::layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/layouts/page.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="btn-group filter-button-group dropdown" style="margin-right:3px">
<button
class="btn btn-primary <?php echo e($btn_class, false); ?>"
<?php if($only_scopes): ?>data-toggle="dropdown"<?php endif; ?>
<?php if($scopes->isNotEmpty()): ?> style="border-right: 0" <?php endif; ?>
>
<i class="feather icon-filter"></i><?php if($filter_text): ?><span class="d-none d-sm-inline">&nbsp;&nbsp;<?php echo e(trans('admin.filter'), false); ?></span><?php endif; ?>
<span class="filter-count"><?php if($valueCount): ?> &nbsp;(<?php echo $valueCount; ?>) <?php endif; ?></span>
</button>
<?php if($scopes->isNotEmpty()): ?>
<ul class="dropdown-menu" role="menu">
<?php $__currentLoopData = $scopes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $scope): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php echo $scope->render(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<li role="separator" class="dropdown-divider"></li>
<li class="dropdown-item"><a href="<?php echo e($url_no_scopes, false); ?>"><?php echo e(trans('admin.cancel'), false); ?></a></li>
</ul>
<button type="button" class="btn btn-primary" data-toggle="dropdown" style="border-left: 0">
<?php if($current_label): ?> <span><?php echo e($current_label, false); ?>&nbsp;</span><?php endif; ?> <i class="feather icon-chevron-down"></i>
</button>
<?php endif; ?>
</div>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/filter/button.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if($help): ?>
<span class="help-block">
<i class="fa <?php echo e(\Illuminate\Support\Arr::get($help, 'icon'), false); ?>"></i>&nbsp;<?php echo \Illuminate\Support\Arr::get($help, 'text'); ?>
</span>
<?php endif; ?><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/form/help-block.blade.php ENDPATH**/ ?>
\ No newline at end of file
<style>
.webuploader-pick {
background-color: <?php echo admin_color()->primary(); ?>;
}
.web-uploader .placeholder .flashTip a {
color: <?php echo admin_color()->primary(-10); ?>;
}
.web-uploader .statusBar .upload-progress span.percentage,
.web-uploader .filelist li p.upload-progress span {
background: <?php echo admin_color()->primary(-8); ?>;
}
.web-uploader .dnd-area.webuploader-dnd-over {
border: 3px dashed #999 !important;
}
.web-uploader .dnd-area.webuploader-dnd-over .placeholder {
border: none;
}
</style>
<div class="<?php echo e($viewClass['form-group'], false); ?> <?php echo e($class, false); ?>">
<label for="<?php echo e($column, false); ?>" class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo $label; ?></label>
<div class="<?php echo e($viewClass['field'], false); ?>">
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<input name="<?php echo e($name, false); ?>" class="file-input" type="hidden" <?php echo $attributes; ?>/>
<div class="web-uploader <?php echo e($fileType, false); ?>">
<div class="queueList dnd-area">
<div class="placeholder">
<div class="file-picker"></div>
<p><?php echo e(trans('admin.uploader.drag_file'), false); ?></p>
</div>
</div>
<div class="statusBar" style="display:none;">
<div class="upload-progress progress progress-bar-primary pull-left">
<div class="progress-bar progress-bar-striped active" style="line-height:18px">0%</div>
</div>
<div class="info"></div>
<div class="btns">
<div class="add-file-button"></div>
<?php if($showUploadBtn): ?>
&nbsp;
<div class="upload-btn btn btn-primary"><i class="feather icon-upload"></i> &nbsp;<?php echo e(trans('admin.upload'), false); ?></div>
<?php endif; ?>
</div>
</div>
</div>
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
<script require="@webuploader" init="<?php echo $selector; ?>">
var uploader,
newPage,
options = <?php echo $options; ?>,
events = options.events;
init();
function init() {
var opts = $.extend({
selector: $this,
addFileButton: $this.find('.add-file-button'),
inputSelector: $this.find('.file-input'),
}, options);
opts.upload = $.extend({
pick: {
id: $this.find('.file-picker'),
name: '_file_',
label: '<i class="feather icon-folder"><\/i>&nbsp; <?php echo trans('admin.uploader.add_new_media'); ?>'
},
dnd: $this.find('.dnd-area'),
paste: $this.find('.web-uploader')
}, opts);
uploader = Dcat.Uploader(opts);
uploader.build();
uploader.preview();
for (var i = 0; i < events.length; i++) {
var evt = events[i];
if (evt.event && evt.script) {
if (evt.once) {
uploader.uploader.once(evt.event, evt.script.bind(uploader))
} else {
uploader.uploader.on(evt.event, evt.script.bind(uploader))
}
}
}
function resize() {
setTimeout(function () {
if (! uploader) return;
uploader.refreshButton();
resize();
if (! newPage) {
newPage = 1;
$(document).one('pjax:complete', function () {
uploader = null;
});
}
}, 250);
}
resize();
}
</script>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/form/file.blade.php ENDPATH**/ ?>
\ No newline at end of file
<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale()), false); ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title><?php if(! empty($header)): ?><?php echo e($header, false); ?> | <?php endif; ?> <?php echo e(Dcat\Admin\Admin::title(), false); ?></title>
<?php if(! config('admin.disable_no_referrer_meta')): ?>
<meta name="referrer" content="no-referrer"/>
<?php endif; ?>
<?php if(! empty($favicon = Dcat\Admin\Admin::favicon())): ?>
<link rel="shortcut icon" href="<?php echo e($favicon, false); ?>">
<?php endif; ?>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['HEAD']); ?>
<?php echo Dcat\Admin\Admin::asset()->headerJsToHtml(); ?>
<?php echo Dcat\Admin\Admin::asset()->cssToHtml(); ?>
</head>
<body class="dcat-admin-body full-page <?php echo e($configData['body_class'], false); ?>">
<script>
var Dcat = CreateDcat(<?php echo Dcat\Admin\Admin::jsVariables(); ?>);
</script>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['BODY_INNER_BEFORE']); ?>
<div class="app-content content">
<div class="wrapper" id="<?php echo e($pjaxContainerId, false); ?>">
<?php echo $__env->yieldContent('app'); ?>
</div>
</div>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['BODY_INNER_AFTER']); ?>
<?php echo Dcat\Admin\Admin::asset()->jsToHtml(); ?>
<script>Dcat.boot();</script>
</body>
</html><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/layouts/full-page.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if($grid->allowPagination()): ?>
<div class="box-footer d-block clearfix ">
<?php echo $grid->paginator()->render(); ?>
</div>
<?php endif; ?>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/table-pagination.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="<?php echo e($viewClass['form-group'], false); ?>">
<div class="<?php echo e($viewClass['label'], false); ?> control-label">
<span><?php echo $label; ?></span>
</div>
<div class="<?php echo e($viewClass['field'], false); ?>">
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<select class="form-control <?php echo e($class, false); ?>" style="width: 100%!important;" name="<?php echo e($name, false); ?>[]" multiple="multiple" data-placeholder="<?php echo e($placeholder, false); ?>" <?php echo $attributes; ?> >
<?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $select => $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($select, false); ?>" <?php echo e(in_array($select, (array) $value) ?'selected':'', false); ?>><?php echo e($option, false); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<input type="hidden" name="<?php echo e($name, false); ?>[]" />
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
<?php echo $__env->make('admin::form.select-script', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/form/multipleselect.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="<?php echo e($viewClass['form-group'], false); ?>">
<label class="<?php echo e($viewClass['label'], false); ?> control-label"><?php echo $label; ?></label>
<div class="<?php echo e($viewClass['field'], false); ?>">
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<input name="<?php echo e($name, false); ?>" type="hidden" value="0" />
<input type="checkbox" name="<?php echo e($name, false); ?>" class="<?php echo e($class, false); ?>" <?php echo e($value == 1 ? 'checked' : '', false); ?> <?php echo $attributes; ?> />
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
<script require="@switchery" init="<?php echo $selector; ?>">
$this.parent().find('.switchery').remove();
$this.each(function() {
new Switchery($(this)[0], $(this).data())
})
</script>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/form/switchfield.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php echo $start; ?>
<div class="box-body fields-group pl-0 pr-0 pt-1" style="padding: 0 0 .5rem">
<?php if(! $tabObj->isEmpty()): ?>
<?php echo $__env->make('admin::form.tab', compact('tabObj'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__currentLoopData = $fields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($field instanceof \Dcat\Admin\Form\Field\Hidden): ?>
<?php echo $field->render(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
<?php echo $__env->make('admin::form.fields', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php endif; ?>
</div>
<?php echo $footer; ?>
<?php echo $end; ?>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/widgets/form.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="<?php echo e($viewClass['form-group'], false); ?>">
<div class="<?php echo e($viewClass['label'], false); ?> control-label">
<span><?php echo $label; ?></span>
</div>
<div class="<?php echo e($viewClass['field'], false); ?>">
<?php echo $__env->make('admin::form.error', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div class="input-group">
<?php if($prepend): ?>
<span class="input-group-prepend"><span class="input-group-text bg-white"><?php echo $prepend; ?></span></span>
<?php endif; ?>
<input <?php echo $attributes; ?> />
<?php if($append): ?>
<span class="input-group-append"><?php echo $append; ?></span>
<?php endif; ?>
</div>
<?php echo $__env->make('admin::form.help-block', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/form/input.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php $__env->startSection('content'); ?>
<section class="content">
<?php echo $__env->make('admin::partials.alerts', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('admin::partials.exception', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $content; ?>
<?php echo $__env->make('admin::partials.toastr', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</section>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('app'); ?>
<?php echo Dcat\Admin\Admin::asset()->styleToHtml(); ?>
<div class="content-body" id="app">
<?php echo admin_section(Dcat\Admin\Admin::SECTION['APP_INNER_BEFORE']); ?>
<?php echo $__env->yieldContent('content'); ?>
<?php echo admin_section(Dcat\Admin\Admin::SECTION['APP_INNER_AFTER']); ?>
</div>
<?php echo Dcat\Admin\Admin::asset()->scriptToHtml(); ?>
<div class="extra-html"><?php echo Dcat\Admin\Admin::html(); ?></div>
<?php $__env->stopSection(); ?>
<?php if(!request()->pjax()): ?>
<?php echo $__env->make('admin::layouts.full-page', ['header' => $header], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php else: ?>
<title><?php echo e(Dcat\Admin\Admin::title(), false); ?> <?php if($header): ?> | <?php echo e($header, false); ?><?php endif; ?></title>
<script>Dcat.wait();</script>
<?php echo Dcat\Admin\Admin::asset()->cssToHtml(); ?>
<?php echo Dcat\Admin\Admin::asset()->jsToHtml(); ?>
<?php echo $__env->yieldContent('app'); ?>
<?php endif; ?>
<?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/layouts/full-content.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div <?php echo $attributes; ?>>
<div class="card-header d-flex justify-content-between align-items-start pb-0">
<div>
<?php if($icon): ?>
<div class="avatar bg-rgba-<?php echo e($style, false); ?> p-50 m-0">
<div class="avatar-content">
<i class="<?php echo e($icon, false); ?> text-<?php echo e($style, false); ?> font-medium-5"></i>
</div>
</div>
<?php endif; ?>
<?php if($title): ?>
<h4 class="card-title mb-1"><?php echo $title; ?></h4>
<?php endif; ?>
<div class="metric-header"><?php echo $header; ?></div>
</div>
<?php if(! empty($subTitle)): ?>
<span class="btn btn-sm bg-light shadow-0 p-0">
<?php echo e($subTitle, false); ?>
</span>
<?php endif; ?>
<?php if(! empty($dropdown)): ?>
<div class="dropdown chart-dropdown">
<button class="btn btn-sm btn-light shadow-0 dropdown-toggle p-0 waves-effect" data-toggle="dropdown">
<?php echo e(current($dropdown), false); ?>
</button>
<div class="dropdown-menu dropdown-menu-right">
<?php $__currentLoopData = $dropdown; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li class="dropdown-item"><a href="javascript:void(0)" class="select-option" data-option="<?php echo e($key, false); ?>"><?php echo e($value, false); ?></a></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<?php endif; ?>
</div>
<div class="metric-content"><?php echo $content; ?></div>
</div><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/widgets/metrics/card.blade.php ENDPATH**/ ?>
\ No newline at end of file
<?php if(!empty($default) || !empty($custom)): ?>
<div class="grid-dropdown-actions dropdown">
<a href="#" style="padding:0 10px;" data-toggle="dropdown">
<i class="feather icon-more-vertical"></i>
</a>
<ul class="dropdown-menu" style="left: -65px;">
<?php $__currentLoopData = $default; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $action): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li class="dropdown-item"><?php echo Dcat\Admin\Support\Helper::render($action); ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if(!empty($custom)): ?>
<?php if(!empty($default)): ?>
<li class="dropdown-divider"></li>
<?php endif; ?>
<?php $__currentLoopData = $custom; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $action): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li class="dropdown-item"><?php echo $action; ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
</ul>
</div>
<?php endif; ?><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/grid/dropdown-actions.blade.php ENDPATH**/ ?>
\ No newline at end of file
<div class="input-group input-group-sm">
<?php if($group): ?>
<div class="input-group-prepend dropdown">
<a class="filter-group input-group-text bg-white dropdown-toggle" data-toggle="dropdown">
<span class="<?php echo e($group_name, false); ?>-label"><?php echo e($default['label'], false); ?>&nbsp; </span>
</a>
<input type="hidden" name="<?php echo e($id, false); ?>_group" class="<?php echo e($group_name, false); ?>-operation" value="<?php echo e(request($id.'_group', 0), false); ?>"/>
<ul class="dropdown-menu <?php echo e($group_name, false); ?>">
<?php $__currentLoopData = $group; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li class="dropdown-item"><a data-index="<?php echo e($index, false); ?>"> <?php echo e($item['label'], false); ?> </a></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
</div>
<?php endif; ?>
<div class="input-group-prepend">
<span class="input-group-text bg-white text-capitalize"><b><?php echo $label; ?></b></span>
</div>
<input type="<?php echo e($type, false); ?>" class="form-control <?php echo e($id, false); ?>" placeholder="<?php echo e($placeholder, false); ?>" name="<?php echo e($name, false); ?>" value="<?php echo e(request($name, $value), false); ?>">
</div><?php /**PATH D:\work\PHP\aimeiyue\all\service\vendor\dcat\laravel-admin\src/../resources/views/filter/text.blade.php ENDPATH**/ ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment