order-profit
parent
45fff9f005
commit
c38749e452
|
|
@ -20,11 +20,12 @@ class OrderProfitController extends AdminController
|
|||
*/
|
||||
protected function grid()
|
||||
{
|
||||
return Grid::make(OrderProfit::with(['order', 'user']), function (Grid $grid) {
|
||||
|
||||
return Grid::make(OrderProfit::with(['order', 'user', 'fromUser']), function (Grid $grid) {
|
||||
|
||||
$grid->disableViewButton(false);
|
||||
|
||||
$grid->column('order.sn');
|
||||
$grid->column('fromUser.phone');
|
||||
$grid->column('user.phone');
|
||||
$grid->column('role_name');
|
||||
$grid->column('growth_value');
|
||||
|
|
@ -34,10 +35,11 @@ class OrderProfitController extends AdminController
|
|||
$grid->column('money');
|
||||
$grid->column('status')->using(OrderProfit::$statusMap)->dot(OrderProfit::$statusColor);
|
||||
$grid->column('created_at');
|
||||
|
||||
|
||||
$grid->filter(function (Grid\Filter $filter) {
|
||||
$filter->panel();
|
||||
$filter->like('order.sn')->width(3);
|
||||
$filter->like('fromUser.phone')->width(3);
|
||||
$filter->like('user.phone')->width(3);
|
||||
});
|
||||
|
||||
|
|
@ -58,9 +60,10 @@ class OrderProfitController extends AdminController
|
|||
*/
|
||||
protected function detail($id)
|
||||
{
|
||||
return Show::make($id, OrderProfit::with(['order', 'user']), function (Show $show) {
|
||||
return Show::make($id, OrderProfit::with(['order', 'user', 'fromUser']), function (Show $show) {
|
||||
$show->field('id');
|
||||
$show->field('order.sn');
|
||||
$show->field('from_user.phone');
|
||||
$show->field('user.phone');
|
||||
$show->field('role_name');
|
||||
$show->field('growth_value');
|
||||
|
|
@ -111,7 +114,7 @@ class OrderProfitController extends AdminController
|
|||
$show->field('pay_way');
|
||||
$show->field('pay_no');
|
||||
$show->field('paid_at');
|
||||
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -58,10 +58,11 @@ class App extends Form
|
|||
|
||||
$this->select('article_help', '帮助文章指定分类')->options(ArticleCategory::whereNull('parent_id')->pluck('name', 'id'))->value($appSettings['article_help'] ?? '');
|
||||
$this->select('article_agreement', '协议文章指定分类')->options(ArticleCategory::whereNull('parent_id')->pluck('name', 'id'))->value($appSettings['article_agreement'] ?? '');
|
||||
$this->select('article_health', '健康文章指定分类')->options(ArticleCategory::whereNull('parent_id')->pluck('name', 'id'))->value($appSettings['article_health'] ?? '');
|
||||
$this->select('article_health', '普通文章指定分类')->options(ArticleCategory::whereNull('parent_id')->pluck('name', 'id'))->value($appSettings['article_health'] ?? '');
|
||||
|
||||
$this->text('article_about_us', '关于我们文章指定(链接)')->value($appSettings['article_about_us'] ?? '');
|
||||
$this->text('article_user_promotion_agreement', '服务协议文章指定(链接)')->value($appSettings['article_user_promotion_agreement'] ?? '');
|
||||
$this->text('article_user_hide_agreement', '隐私协议文章指定(链接)')->value($appSettings['article_user_hide_agreement'] ?? '');
|
||||
$this->text('article_profit', '佣金说明文章指定(链接)')->value($appSettings['article_profit'] ?? '');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,13 +31,19 @@ class ArticleController extends Controller
|
|||
'about_us'=>app_settings('app.article_about_us', ''),
|
||||
'user_promotion_agreement'=> app_settings('app.article_user_promotion_agreement', ''),
|
||||
'user_hide_agreement' => app_settings('app.article_user_hide_agreement', ''),
|
||||
'article_profit' => app_settings('app.article_profit', ''),
|
||||
]);
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$categoryId = (string) $request->query('cate');
|
||||
$cate = (string) $request->query('cate');
|
||||
$key = (string) $request->query('key');
|
||||
$categoryId = Arr::get([
|
||||
'help'=> app_settings('app.article_help'),
|
||||
'agreement'=> app_settings('app.article_agreement'),
|
||||
'health'=> app_settings('app.article_health'),
|
||||
], $cate);
|
||||
$query = Article::where('is_show', 1);
|
||||
if ($categoryId) {
|
||||
$query->where('category_id', $categoryId);
|
||||
|
|
|
|||
|
|
@ -1,187 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Endpoint\Api\Http\Controllers;
|
||||
|
||||
use App\Endpoint\Api\Http\Resources\ArticleCategoryResource;
|
||||
use App\Endpoint\Api\Http\Resources\ArticleResource;
|
||||
use App\Endpoint\Api\Http\Resources\ArticleSimpleResource;
|
||||
use App\Exceptions\BizException;
|
||||
use App\Helpers\Paginator as PaginatorHelper;
|
||||
use App\Models\Article;
|
||||
use App\Models\ArticleCategory;
|
||||
use App\Models\ArticleLikesLog;
|
||||
use App\Models\ArticlePointsLog;
|
||||
use App\Models\PointsLog;
|
||||
use App\Services\PointsService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Throwable;
|
||||
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
/**
|
||||
* 指定文章配置:关于我们、用户推广协议、隐私协议
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function config(Request $request)
|
||||
{
|
||||
return response()->json([
|
||||
'about_us'=>app_settings('app.article_about_us', ''),
|
||||
'user_promotion_agreement'=> app_settings('app.article_user_promotion_agreement', ''),
|
||||
'user_hide_agreement' => app_settings('app.article_user_hide_agreement', ''),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$cate = (string) $request->query('cate');
|
||||
$key = (string) $request->query('key');
|
||||
$categoryId = Arr::get([
|
||||
'help'=> app_settings('app.article_help'),
|
||||
'agreement'=> app_settings('app.article_agreement'),
|
||||
'health'=> app_settings('app.article_health'),
|
||||
], $cate);
|
||||
$query = Article::query()->with(['likesInfo'=>function ($q) use ($request) {
|
||||
$user_id = $request->user()?->id;
|
||||
return $q->where('user_id', $user_id ?? 0);
|
||||
}])->where('is_show', 1);
|
||||
if ($categoryId) {
|
||||
$query->where('category_id', $categoryId);
|
||||
}
|
||||
if ($key) {
|
||||
$query->where('title', 'like', '%'.$key.'%');
|
||||
}
|
||||
|
||||
$query->orderBy('is_recommend', 'desc');
|
||||
$query->orderBy('sort', 'desc');
|
||||
$query->orderBy('created_at', 'desc');
|
||||
|
||||
$list = $query->simplePaginate(PaginatorHelper::resolvePerPage('per_page', 20, 50));
|
||||
return ArticleSimpleResource::collection($list);
|
||||
}
|
||||
|
||||
public function healthCategory(Request $request)
|
||||
{
|
||||
$key = (string) $request->query('key');
|
||||
$categoryId = app_settings('app.article_health');
|
||||
$query = ArticleCategory::query()->where('parent_id', $categoryId)->where('is_show', 1);
|
||||
|
||||
if ($key) {
|
||||
$query->where('name', 'like', '%'.$key.'%');
|
||||
}
|
||||
|
||||
$query->orderBy('is_recommend', 'desc');
|
||||
$query->orderBy('sort', 'desc');
|
||||
$query->orderBy('created_at', 'desc');
|
||||
|
||||
$categories = $query->get();
|
||||
|
||||
return ArticleCategoryResource::collection($categories);
|
||||
}
|
||||
|
||||
public function articleList($id, Request $request)
|
||||
{
|
||||
$key = (string) $request->query('key');
|
||||
$categoryId = $id;
|
||||
$query = Article::query()->with(['likesInfo'=>function ($q) use ($request) {
|
||||
$user_id = $request->user()?->id;
|
||||
return $q->where('user_id', $user_id ?? 0);
|
||||
}])->where('is_show', 1);
|
||||
if ($categoryId) {
|
||||
$query->where('category_id', $categoryId);
|
||||
}
|
||||
if ($key) {
|
||||
$query->where('title', 'like', '%'.$key.'%');
|
||||
}
|
||||
|
||||
$query->orderBy('is_recommend', 'desc');
|
||||
$query->orderBy('sort', 'desc');
|
||||
$query->orderBy('created_at', 'desc');
|
||||
|
||||
$list = $query->simplePaginate(PaginatorHelper::resolvePerPage('per_page', 20, 50));
|
||||
return ArticleSimpleResource::collection($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章详情
|
||||
*
|
||||
* @param [type] $id
|
||||
* @return void
|
||||
*/
|
||||
public function show($id, Request $request)
|
||||
{
|
||||
$article = Article::with(['likesInfo'=>function ($q) use ($request) {
|
||||
return $q->where('user_id', $request->user()->id);
|
||||
}])->where('is_show', 1)->findOrFail($id);
|
||||
return ArticleResource::make($article);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章点赞
|
||||
*
|
||||
* @param [type] $id
|
||||
* @param Request $request
|
||||
* @return void
|
||||
*/
|
||||
public function like($id, Request $request)
|
||||
{
|
||||
$article = Article::where('is_show', 1)->findOrFail($id);
|
||||
if (ArticleLikesLog::where('user_id', $request->user()->id)->where('article_id', $article->id)->exists()) {
|
||||
throw new BizException('您已点赞过这篇文章');
|
||||
}
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
ArticleLikesLog::create([
|
||||
'article_id' => $article->id,
|
||||
'user_id' => $request->user()->id,
|
||||
]);
|
||||
$article->increment('likes');
|
||||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
report($th);
|
||||
throw new BizException('系统繁忙,请稍后再试');
|
||||
}
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* 阅读加积分接口
|
||||
*
|
||||
* @param [type] $id
|
||||
* @return void
|
||||
*/
|
||||
public function read($id, Request $request, PointsService $pointsService)
|
||||
{
|
||||
$article = Article::where('is_show', 1)->findOrFail($id);
|
||||
if ($article->points > 0) {
|
||||
if (ArticlePointsLog::where('user_id', $request->user()->id)->whereDate('created_at', now())->exists()) {
|
||||
throw new BizException('您今天已拿过积分了,请明天再来');
|
||||
}
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
ArticlePointsLog::create([
|
||||
'user_id' => $request->user()->id,
|
||||
'article_id' => $article->id,
|
||||
]);
|
||||
$pointsService->sendPoints(PointsLog::TYPE_READ, $request->user(), $article->points, '阅读文章送积分');
|
||||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
report($th);
|
||||
throw new BizException('系统繁忙,请稍后再试');
|
||||
}
|
||||
}
|
||||
return response()->json([
|
||||
'points'=>$article->points,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Endpoint\Api\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Endpoint\Api\Http\Resources\OrderProfitResource;
|
||||
|
||||
class ProfitController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$user = $request->user();
|
||||
|
||||
$query = $user->profits()->with(['order', 'fromUser']);
|
||||
|
||||
if ($request->filled('status')) {
|
||||
$query->where('status', $request->input('status'));
|
||||
}
|
||||
|
||||
$list = $query->paginate($request->input('per_page'));
|
||||
|
||||
return OrderProfitResource::collection($list);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace App\Endpoint\Api\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class OrderProfitResource extends JsonResource
|
||||
{
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'order_id' => $this->order_id,
|
||||
'order' => $this->when($this->whenLoaded('order'), [
|
||||
'id' => $this->order?->id,
|
||||
'sn' => $this->order?->sn,
|
||||
'total_amount' => $this->order?->total_amount
|
||||
]),
|
||||
'from_user_id' => $this->from_user_id,
|
||||
'user_id' => $this->user_id,
|
||||
// 'order' => OrderResource::make($this->whenLoaded('order')),
|
||||
'from_user' => $this->when($this->whenLoaded('fromUser'), [
|
||||
'id' => $this->fromUser?->id,
|
||||
'phone' => $this->fromUser?->phone
|
||||
]),
|
||||
|
||||
'growth_value' => $this->growth_value,
|
||||
'ratio' => $this->ratio,
|
||||
'money' => $this->money,
|
||||
'sub_money' => $this->sub_money,
|
||||
'status' => $this->status,
|
||||
'created_at' => $this->created_at->timestamp,
|
||||
'paid_at' => $this->paid_at?->timestamp,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -204,6 +204,9 @@ Route::group([
|
|||
Route::get('vip', [\App\Endpoint\Api\Http\Controllers\VipController::class, 'index']);
|
||||
Route::get('vip/buy', [\App\Endpoint\Api\Http\Controllers\VipController::class, 'list']);
|
||||
Route::post('vip/buy', [\App\Endpoint\Api\Http\Controllers\VipController::class, 'buy']);
|
||||
|
||||
// 佣金
|
||||
Route::apiResource('profit', \App\Endpoint\Api\Http\Controllers\ProfitController::class)->only(['index', 'show']);
|
||||
});
|
||||
|
||||
// 微信小程序
|
||||
|
|
@ -228,7 +231,6 @@ Route::group([
|
|||
Route::get('articles/category', [ArticleController::class, 'category']);
|
||||
Route::get('articles/category-tree', [ArticleController::class, 'categoryTree']);
|
||||
Route::get('articles/{article}', [ArticleController::class, 'show']);
|
||||
/** 以前的路由 */
|
||||
Route::get('article-config', [ArticleController::class, 'config']);
|
||||
Route::get('articles', [ArticleController::class, 'index']);
|
||||
Route::group(['middleware' => ['auth:api', \App\Endpoint\Api\Http\Middleware\CheckUserStatus::class]], function () {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class OrderProfit extends Model
|
|||
3 => 'danger'
|
||||
];
|
||||
|
||||
protected $fillable = ['id', 'order_id', 'from_user_id', 'user_id', 'role', 'role_name', 'growth_value', 'ratio', 'money', 'status', 'paid_at', 'pay_no', 'pay_way', 'pay_data', 'remarks'];
|
||||
protected $fillable = ['id', 'order_id', 'from_user_id', 'user_id', 'role', 'role_name', 'growth_value', 'ratio', 'money', 'sub_money', 'status', 'paid_at', 'pay_no', 'pay_way', 'pay_data', 'remarks'];
|
||||
|
||||
public function user()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -279,6 +279,11 @@ class User extends Model implements AuthorizableContract, AuthenticatableContrac
|
|||
return $this->belongsTo(Agent::class, 'agent_id');
|
||||
}
|
||||
|
||||
public function profits()
|
||||
{
|
||||
return $this->hasMany(OrderProfit::class, 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的粉丝总数
|
||||
*
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ class DistributeService
|
|||
{
|
||||
/**
|
||||
* 根据订单, 更新成长值, 添加返现记录
|
||||
*
|
||||
*
|
||||
* @param \App\Models\Order $order
|
||||
*
|
||||
*
|
||||
* @return \App\Models\OrderProfit
|
||||
*/
|
||||
public function storeByOrder(Order $order)
|
||||
|
|
@ -85,7 +85,8 @@ class DistributeService
|
|||
'role_name' => $agent->name,
|
||||
'ratio' => $agent->ratio,
|
||||
'growth_value' => $sales_value,
|
||||
'money' => $money
|
||||
'money' => $money,
|
||||
'sub_money' => $money_sum,
|
||||
]);
|
||||
$money_sum += $money;
|
||||
}
|
||||
|
|
@ -98,9 +99,9 @@ class DistributeService
|
|||
|
||||
/**
|
||||
* 判断订单是否可以生成返利
|
||||
*
|
||||
*
|
||||
* @param \App\Models\Order $order
|
||||
*
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function canDistribute(Order $order)
|
||||
|
|
@ -150,7 +151,7 @@ class DistributeService
|
|||
|
||||
/**
|
||||
* 返现记录支付成功
|
||||
*
|
||||
*
|
||||
* @param \App\Models\OrderProfit $profit
|
||||
* @param mixed $data
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ class CreateOrdersTable extends Migration
|
|||
$table->unsignedBigInteger('products_total_amount')->comment('商品总额');
|
||||
$table->unsignedBigInteger('user_coupon_id')->nullable()->comment('用户优惠券ID');
|
||||
$table->unsignedBigInteger('total_amount')->comment('订单总额(支付金额)=商品总额+运费-优惠券金额-会员优惠-减免金额');
|
||||
$table->bigInteger('market_price')->unsigned()->default(0)->comment('市场价格:分');
|
||||
$table->bigInteger('cost_price')->unsigned()->default(0)->comment('成本价格:分');
|
||||
$table->string('note')->nullable()->comment('客户备注');
|
||||
$table->string('remark')->nullable()->comment('订单备注');
|
||||
// 支付信息
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ class CreateOrderProductsTable extends Migration
|
|||
$table->unsignedInteger('weight')->default(0)->comment('重量:g');
|
||||
$table->unsignedBigInteger('sell_price')->comment('商品价格');
|
||||
$table->unsignedBigInteger('vip_price')->nullable()->comment('会员价格');
|
||||
$table->bigInteger('market_price')->unsigned()->default(0)->comment('市场价格:分');
|
||||
$table->bigInteger('cost_price')->unsigned()->default(0)->comment('成本价格:分');
|
||||
$table->unsignedBigInteger('coupon_discount_amount')->default(0)->comment('优惠券金额');
|
||||
$table->unsignedBigInteger('vip_discount_amount')->default(0)->comment('会员优惠');
|
||||
$table->unsignedBigInteger('reduced_amount')->default(0)->comment('减免金额');
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class CreateOrderProfitsTable extends Migration
|
|||
$table->decimal('growth_value', 12, 2)->comment('成长值');
|
||||
$table->integer('ratio')->comment('比例');
|
||||
$table->decimal('money', 12, 2)->comment('收益金额');
|
||||
$table->decimal('sub_money', 12, 2)->default(0)->comment('下级收益');
|
||||
$table->tinyInteger('status')->default(0)->comment('状态(0: 待付款, 1: 付款中, 2: 已付款)');
|
||||
$table->string('remarks')->nullable()->comment('备注');
|
||||
$table->timestamp('paid_at')->nullable()->comment('付款时间');
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCostPriceToOrders extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->bigInteger('market_price')->unsigned()->default(0)->comment('市场价格:分');
|
||||
$table->bigInteger('cost_price')->unsigned()->default(0)->comment('成本价格:分');
|
||||
});
|
||||
|
||||
Schema::table('order_products', function (Blueprint $table) {
|
||||
$table->bigInteger('market_price')->unsigned()->default(0)->comment('市场价格:分');
|
||||
$table->bigInteger('cost_price')->unsigned()->default(0)->comment('成本价格:分');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->dropColumn(['market_price', 'cost_price']);
|
||||
});
|
||||
Schema::table('order_products', function (Blueprint $table) {
|
||||
$table->dropColumn(['market_price', 'cost_price']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSubMoneyToOrderProfits extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('order_profits', function (Blueprint $table) {
|
||||
$table->decimal('sub_money', 12, 2)->default(0)->comment('下级收益')->after('money');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('order_profits', function (Blueprint $table) {
|
||||
$table->dropColumn(['sub_money']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AdministratorSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
@ -35,6 +35,7 @@ class AppSettingSeeder extends Seeder
|
|||
'article_about_us' => env('APP_URL', '').'/h5/articles/1',
|
||||
'article_user_promotion_agreement' => env('APP_URL', '').'/h5/articles/2',
|
||||
'article_user_hide_agreement' => env('APP_URL', '').'/h5/articles/3',
|
||||
'article_profit' => env('APP_URL', '').'/h5/articles/4',
|
||||
'invite_uri' => '',
|
||||
'search_hot_keys' => '搜索热词,分词1,分词2,分词3',
|
||||
],
|
||||
|
|
|
|||
|
|
@ -17,20 +17,26 @@ class ArticleSeeder extends Seeder
|
|||
Article::truncate();
|
||||
ArticleCategory::truncate();
|
||||
$categoris = [
|
||||
['name' => '自然', 'is_show' => 1, 'is_recommend' => 1],
|
||||
['name' => '文化', 'is_show' => 1, 'is_recommend' => 1],
|
||||
['name' => '生活', 'is_show' => 1, 'is_recommend' => 1],
|
||||
['name' => '帮助', 'is_show' => 1],
|
||||
['name' => '协议', 'is_show' => 1],
|
||||
['name' => '文章', 'is_show' => 1, 'children' => [
|
||||
['name' => '自然', 'is_show' => 1],
|
||||
['name' => '文化', 'is_show' => 1],
|
||||
['name' => '生活', 'is_show' => 1],
|
||||
]],
|
||||
];
|
||||
foreach($categoris as $item) {
|
||||
$category = ArticleCategory::create($item);
|
||||
Article::factory()->count(10)->create(['category_id' => $category->id]);
|
||||
}
|
||||
|
||||
foreach(Article::get() as $item) {
|
||||
$item->update([
|
||||
'jump_type' => 1,
|
||||
'jump_link' => 'pages/article_details/article_details?id=' . $item->id
|
||||
]);
|
||||
$articles = [
|
||||
['category_id' => 2, 'title' => '关于我们', 'author_name' => 'Administrator', 'jump_type' => 0, 'is_show' => 1],
|
||||
['category_id' => 2, 'title' => '服务协议', 'author_name' => 'Administrator', 'jump_type' => 0, 'is_show' => 1],
|
||||
['category_id' => 2, 'title' => '隐私协议', 'author_name' => 'Administrator', 'jump_type' => 0, 'is_show' => 1],
|
||||
['category_id' => 2, 'title' => '佣金说明', 'author_name' => 'Administrator', 'jump_type' => 0, 'is_show' => 1],
|
||||
];
|
||||
foreach($articles as $item) {
|
||||
$article = Article::create($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,6 +131,12 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection payload
|
||||
* @property Grid\Column|Collection exception
|
||||
* @property Grid\Column|Collection failed_at
|
||||
* @property Grid\Column|Collection form_data
|
||||
* @property Grid\Column|Collection author_id
|
||||
* @property Grid\Column|Collection source_type
|
||||
* @property Grid\Column|Collection source_id
|
||||
* @property Grid\Column|Collection user_data
|
||||
* @property Grid\Column|Collection form_id
|
||||
* @property Grid\Column|Collection job_id
|
||||
* @property Grid\Column|Collection reason
|
||||
* @property Grid\Column|Collection file
|
||||
|
|
@ -152,6 +158,7 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection shipping_number
|
||||
* @property Grid\Column|Collection is_failed
|
||||
* @property Grid\Column|Collection checked_at
|
||||
* @property Grid\Column|Collection inviter_id
|
||||
* @property Grid\Column|Collection last_news
|
||||
* @property Grid\Column|Collection store_id
|
||||
* @property Grid\Column|Collection products
|
||||
|
|
@ -170,6 +177,8 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection remain_quantity
|
||||
* @property Grid\Column|Collection gift_for_sku_id
|
||||
* @property Grid\Column|Collection is_gift
|
||||
* @property Grid\Column|Collection market_price
|
||||
* @property Grid\Column|Collection cost_price
|
||||
* @property Grid\Column|Collection from_user_id
|
||||
* @property Grid\Column|Collection role
|
||||
* @property Grid\Column|Collection role_name
|
||||
|
|
@ -189,9 +198,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection shipping_state
|
||||
* @property Grid\Column|Collection completed_at
|
||||
* @property Grid\Column|Collection profit
|
||||
* @property Grid\Column|Collection inviter_id
|
||||
* @property Grid\Column|Collection source_type
|
||||
* @property Grid\Column|Collection source_id
|
||||
* @property Grid\Column|Collection is_change
|
||||
* @property Grid\Column|Collection out_trade_no
|
||||
* @property Grid\Column|Collection auto_complete_at
|
||||
|
|
@ -208,8 +214,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection attrs
|
||||
* @property Grid\Column|Collection applicant_id
|
||||
* @property Grid\Column|Collection reviewer_id
|
||||
* @property Grid\Column|Collection market_price
|
||||
* @property Grid\Column|Collection cost_price
|
||||
* @property Grid\Column|Collection media
|
||||
* @property Grid\Column|Collection sales
|
||||
* @property Grid\Column|Collection release_at
|
||||
|
|
@ -241,6 +245,8 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection socialite_id
|
||||
* @property Grid\Column|Collection product_sku_id
|
||||
* @property Grid\Column|Collection tag_id
|
||||
* @property Grid\Column|Collection operator_type
|
||||
* @property Grid\Column|Collection operator_id
|
||||
* @property Grid\Column|Collection taggable_id
|
||||
* @property Grid\Column|Collection taggable_type
|
||||
* @property Grid\Column|Collection real_name
|
||||
|
|
@ -264,8 +270,10 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection is_company
|
||||
* @property Grid\Column|Collection invite_qrcode
|
||||
* @property Grid\Column|Collection vip_id
|
||||
* @property Grid\Column|Collection price
|
||||
* @property Grid\Column|Collection gift
|
||||
* @property Grid\Column|Collection success_time
|
||||
* @property Grid\Column|Collection expired
|
||||
* @property Grid\Column|Collection phone_verified_at
|
||||
* @property Grid\Column|Collection email
|
||||
* @property Grid\Column|Collection email_verified_at
|
||||
|
|
@ -276,7 +284,6 @@ namespace Dcat\Admin {
|
|||
* @property Grid\Column|Collection old_password
|
||||
* @property Grid\Column|Collection agent_id
|
||||
* @property Grid\Column|Collection vip_expired
|
||||
* @property Grid\Column|Collection price
|
||||
* @property Grid\Column|Collection rate
|
||||
* @property Grid\Column|Collection service_amount
|
||||
* @property Grid\Column|Collection account_amount
|
||||
|
|
@ -402,6 +409,12 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection payload(string $label = null)
|
||||
* @method Grid\Column|Collection exception(string $label = null)
|
||||
* @method Grid\Column|Collection failed_at(string $label = null)
|
||||
* @method Grid\Column|Collection form_data(string $label = null)
|
||||
* @method Grid\Column|Collection author_id(string $label = null)
|
||||
* @method Grid\Column|Collection source_type(string $label = null)
|
||||
* @method Grid\Column|Collection source_id(string $label = null)
|
||||
* @method Grid\Column|Collection user_data(string $label = null)
|
||||
* @method Grid\Column|Collection form_id(string $label = null)
|
||||
* @method Grid\Column|Collection job_id(string $label = null)
|
||||
* @method Grid\Column|Collection reason(string $label = null)
|
||||
* @method Grid\Column|Collection file(string $label = null)
|
||||
|
|
@ -423,6 +436,7 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection shipping_number(string $label = null)
|
||||
* @method Grid\Column|Collection is_failed(string $label = null)
|
||||
* @method Grid\Column|Collection checked_at(string $label = null)
|
||||
* @method Grid\Column|Collection inviter_id(string $label = null)
|
||||
* @method Grid\Column|Collection last_news(string $label = null)
|
||||
* @method Grid\Column|Collection store_id(string $label = null)
|
||||
* @method Grid\Column|Collection products(string $label = null)
|
||||
|
|
@ -441,6 +455,8 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection remain_quantity(string $label = null)
|
||||
* @method Grid\Column|Collection gift_for_sku_id(string $label = null)
|
||||
* @method Grid\Column|Collection is_gift(string $label = null)
|
||||
* @method Grid\Column|Collection market_price(string $label = null)
|
||||
* @method Grid\Column|Collection cost_price(string $label = null)
|
||||
* @method Grid\Column|Collection from_user_id(string $label = null)
|
||||
* @method Grid\Column|Collection role(string $label = null)
|
||||
* @method Grid\Column|Collection role_name(string $label = null)
|
||||
|
|
@ -460,9 +476,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection shipping_state(string $label = null)
|
||||
* @method Grid\Column|Collection completed_at(string $label = null)
|
||||
* @method Grid\Column|Collection profit(string $label = null)
|
||||
* @method Grid\Column|Collection inviter_id(string $label = null)
|
||||
* @method Grid\Column|Collection source_type(string $label = null)
|
||||
* @method Grid\Column|Collection source_id(string $label = null)
|
||||
* @method Grid\Column|Collection is_change(string $label = null)
|
||||
* @method Grid\Column|Collection out_trade_no(string $label = null)
|
||||
* @method Grid\Column|Collection auto_complete_at(string $label = null)
|
||||
|
|
@ -479,8 +492,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection attrs(string $label = null)
|
||||
* @method Grid\Column|Collection applicant_id(string $label = null)
|
||||
* @method Grid\Column|Collection reviewer_id(string $label = null)
|
||||
* @method Grid\Column|Collection market_price(string $label = null)
|
||||
* @method Grid\Column|Collection cost_price(string $label = null)
|
||||
* @method Grid\Column|Collection media(string $label = null)
|
||||
* @method Grid\Column|Collection sales(string $label = null)
|
||||
* @method Grid\Column|Collection release_at(string $label = null)
|
||||
|
|
@ -512,6 +523,8 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection socialite_id(string $label = null)
|
||||
* @method Grid\Column|Collection product_sku_id(string $label = null)
|
||||
* @method Grid\Column|Collection tag_id(string $label = null)
|
||||
* @method Grid\Column|Collection operator_type(string $label = null)
|
||||
* @method Grid\Column|Collection operator_id(string $label = null)
|
||||
* @method Grid\Column|Collection taggable_id(string $label = null)
|
||||
* @method Grid\Column|Collection taggable_type(string $label = null)
|
||||
* @method Grid\Column|Collection real_name(string $label = null)
|
||||
|
|
@ -535,8 +548,10 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection is_company(string $label = null)
|
||||
* @method Grid\Column|Collection invite_qrcode(string $label = null)
|
||||
* @method Grid\Column|Collection vip_id(string $label = null)
|
||||
* @method Grid\Column|Collection price(string $label = null)
|
||||
* @method Grid\Column|Collection gift(string $label = null)
|
||||
* @method Grid\Column|Collection success_time(string $label = null)
|
||||
* @method Grid\Column|Collection expired(string $label = null)
|
||||
* @method Grid\Column|Collection phone_verified_at(string $label = null)
|
||||
* @method Grid\Column|Collection email(string $label = null)
|
||||
* @method Grid\Column|Collection email_verified_at(string $label = null)
|
||||
|
|
@ -547,7 +562,6 @@ namespace Dcat\Admin {
|
|||
* @method Grid\Column|Collection old_password(string $label = null)
|
||||
* @method Grid\Column|Collection agent_id(string $label = null)
|
||||
* @method Grid\Column|Collection vip_expired(string $label = null)
|
||||
* @method Grid\Column|Collection price(string $label = null)
|
||||
* @method Grid\Column|Collection rate(string $label = null)
|
||||
* @method Grid\Column|Collection service_amount(string $label = null)
|
||||
* @method Grid\Column|Collection account_amount(string $label = null)
|
||||
|
|
@ -678,6 +692,12 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection payload
|
||||
* @property Show\Field|Collection exception
|
||||
* @property Show\Field|Collection failed_at
|
||||
* @property Show\Field|Collection form_data
|
||||
* @property Show\Field|Collection author_id
|
||||
* @property Show\Field|Collection source_type
|
||||
* @property Show\Field|Collection source_id
|
||||
* @property Show\Field|Collection user_data
|
||||
* @property Show\Field|Collection form_id
|
||||
* @property Show\Field|Collection job_id
|
||||
* @property Show\Field|Collection reason
|
||||
* @property Show\Field|Collection file
|
||||
|
|
@ -699,6 +719,7 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection shipping_number
|
||||
* @property Show\Field|Collection is_failed
|
||||
* @property Show\Field|Collection checked_at
|
||||
* @property Show\Field|Collection inviter_id
|
||||
* @property Show\Field|Collection last_news
|
||||
* @property Show\Field|Collection store_id
|
||||
* @property Show\Field|Collection products
|
||||
|
|
@ -717,6 +738,8 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection remain_quantity
|
||||
* @property Show\Field|Collection gift_for_sku_id
|
||||
* @property Show\Field|Collection is_gift
|
||||
* @property Show\Field|Collection market_price
|
||||
* @property Show\Field|Collection cost_price
|
||||
* @property Show\Field|Collection from_user_id
|
||||
* @property Show\Field|Collection role
|
||||
* @property Show\Field|Collection role_name
|
||||
|
|
@ -736,9 +759,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection shipping_state
|
||||
* @property Show\Field|Collection completed_at
|
||||
* @property Show\Field|Collection profit
|
||||
* @property Show\Field|Collection inviter_id
|
||||
* @property Show\Field|Collection source_type
|
||||
* @property Show\Field|Collection source_id
|
||||
* @property Show\Field|Collection is_change
|
||||
* @property Show\Field|Collection out_trade_no
|
||||
* @property Show\Field|Collection auto_complete_at
|
||||
|
|
@ -755,8 +775,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection attrs
|
||||
* @property Show\Field|Collection applicant_id
|
||||
* @property Show\Field|Collection reviewer_id
|
||||
* @property Show\Field|Collection market_price
|
||||
* @property Show\Field|Collection cost_price
|
||||
* @property Show\Field|Collection media
|
||||
* @property Show\Field|Collection sales
|
||||
* @property Show\Field|Collection release_at
|
||||
|
|
@ -788,6 +806,8 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection socialite_id
|
||||
* @property Show\Field|Collection product_sku_id
|
||||
* @property Show\Field|Collection tag_id
|
||||
* @property Show\Field|Collection operator_type
|
||||
* @property Show\Field|Collection operator_id
|
||||
* @property Show\Field|Collection taggable_id
|
||||
* @property Show\Field|Collection taggable_type
|
||||
* @property Show\Field|Collection real_name
|
||||
|
|
@ -811,8 +831,10 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection is_company
|
||||
* @property Show\Field|Collection invite_qrcode
|
||||
* @property Show\Field|Collection vip_id
|
||||
* @property Show\Field|Collection price
|
||||
* @property Show\Field|Collection gift
|
||||
* @property Show\Field|Collection success_time
|
||||
* @property Show\Field|Collection expired
|
||||
* @property Show\Field|Collection phone_verified_at
|
||||
* @property Show\Field|Collection email
|
||||
* @property Show\Field|Collection email_verified_at
|
||||
|
|
@ -823,7 +845,6 @@ namespace Dcat\Admin {
|
|||
* @property Show\Field|Collection old_password
|
||||
* @property Show\Field|Collection agent_id
|
||||
* @property Show\Field|Collection vip_expired
|
||||
* @property Show\Field|Collection price
|
||||
* @property Show\Field|Collection rate
|
||||
* @property Show\Field|Collection service_amount
|
||||
* @property Show\Field|Collection account_amount
|
||||
|
|
@ -949,6 +970,12 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection payload(string $label = null)
|
||||
* @method Show\Field|Collection exception(string $label = null)
|
||||
* @method Show\Field|Collection failed_at(string $label = null)
|
||||
* @method Show\Field|Collection form_data(string $label = null)
|
||||
* @method Show\Field|Collection author_id(string $label = null)
|
||||
* @method Show\Field|Collection source_type(string $label = null)
|
||||
* @method Show\Field|Collection source_id(string $label = null)
|
||||
* @method Show\Field|Collection user_data(string $label = null)
|
||||
* @method Show\Field|Collection form_id(string $label = null)
|
||||
* @method Show\Field|Collection job_id(string $label = null)
|
||||
* @method Show\Field|Collection reason(string $label = null)
|
||||
* @method Show\Field|Collection file(string $label = null)
|
||||
|
|
@ -970,6 +997,7 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection shipping_number(string $label = null)
|
||||
* @method Show\Field|Collection is_failed(string $label = null)
|
||||
* @method Show\Field|Collection checked_at(string $label = null)
|
||||
* @method Show\Field|Collection inviter_id(string $label = null)
|
||||
* @method Show\Field|Collection last_news(string $label = null)
|
||||
* @method Show\Field|Collection store_id(string $label = null)
|
||||
* @method Show\Field|Collection products(string $label = null)
|
||||
|
|
@ -988,6 +1016,8 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection remain_quantity(string $label = null)
|
||||
* @method Show\Field|Collection gift_for_sku_id(string $label = null)
|
||||
* @method Show\Field|Collection is_gift(string $label = null)
|
||||
* @method Show\Field|Collection market_price(string $label = null)
|
||||
* @method Show\Field|Collection cost_price(string $label = null)
|
||||
* @method Show\Field|Collection from_user_id(string $label = null)
|
||||
* @method Show\Field|Collection role(string $label = null)
|
||||
* @method Show\Field|Collection role_name(string $label = null)
|
||||
|
|
@ -1007,9 +1037,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection shipping_state(string $label = null)
|
||||
* @method Show\Field|Collection completed_at(string $label = null)
|
||||
* @method Show\Field|Collection profit(string $label = null)
|
||||
* @method Show\Field|Collection inviter_id(string $label = null)
|
||||
* @method Show\Field|Collection source_type(string $label = null)
|
||||
* @method Show\Field|Collection source_id(string $label = null)
|
||||
* @method Show\Field|Collection is_change(string $label = null)
|
||||
* @method Show\Field|Collection out_trade_no(string $label = null)
|
||||
* @method Show\Field|Collection auto_complete_at(string $label = null)
|
||||
|
|
@ -1026,8 +1053,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection attrs(string $label = null)
|
||||
* @method Show\Field|Collection applicant_id(string $label = null)
|
||||
* @method Show\Field|Collection reviewer_id(string $label = null)
|
||||
* @method Show\Field|Collection market_price(string $label = null)
|
||||
* @method Show\Field|Collection cost_price(string $label = null)
|
||||
* @method Show\Field|Collection media(string $label = null)
|
||||
* @method Show\Field|Collection sales(string $label = null)
|
||||
* @method Show\Field|Collection release_at(string $label = null)
|
||||
|
|
@ -1059,6 +1084,8 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection socialite_id(string $label = null)
|
||||
* @method Show\Field|Collection product_sku_id(string $label = null)
|
||||
* @method Show\Field|Collection tag_id(string $label = null)
|
||||
* @method Show\Field|Collection operator_type(string $label = null)
|
||||
* @method Show\Field|Collection operator_id(string $label = null)
|
||||
* @method Show\Field|Collection taggable_id(string $label = null)
|
||||
* @method Show\Field|Collection taggable_type(string $label = null)
|
||||
* @method Show\Field|Collection real_name(string $label = null)
|
||||
|
|
@ -1082,8 +1109,10 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection is_company(string $label = null)
|
||||
* @method Show\Field|Collection invite_qrcode(string $label = null)
|
||||
* @method Show\Field|Collection vip_id(string $label = null)
|
||||
* @method Show\Field|Collection price(string $label = null)
|
||||
* @method Show\Field|Collection gift(string $label = null)
|
||||
* @method Show\Field|Collection success_time(string $label = null)
|
||||
* @method Show\Field|Collection expired(string $label = null)
|
||||
* @method Show\Field|Collection phone_verified_at(string $label = null)
|
||||
* @method Show\Field|Collection email(string $label = null)
|
||||
* @method Show\Field|Collection email_verified_at(string $label = null)
|
||||
|
|
@ -1094,7 +1123,6 @@ namespace Dcat\Admin {
|
|||
* @method Show\Field|Collection old_password(string $label = null)
|
||||
* @method Show\Field|Collection agent_id(string $label = null)
|
||||
* @method Show\Field|Collection vip_expired(string $label = null)
|
||||
* @method Show\Field|Collection price(string $label = null)
|
||||
* @method Show\Field|Collection rate(string $label = null)
|
||||
* @method Show\Field|Collection service_amount(string $label = null)
|
||||
* @method Show\Field|Collection account_amount(string $label = null)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php
|
||||
return [
|
||||
'labels' => [
|
||||
'OrderProfit' => '提成记录',
|
||||
|
|
@ -20,10 +20,17 @@ return [
|
|||
'user' => [
|
||||
'phone' => '用户'
|
||||
],
|
||||
'fromUser' => [
|
||||
'phone' => '下单用户'
|
||||
],
|
||||
'from_user' => [
|
||||
'phone' => '下单用户'
|
||||
],
|
||||
'remarks' => '备注',
|
||||
'paid_at' => '付款时间',
|
||||
'pay_way' => '支付方式',
|
||||
'pay_no' => '流水号',
|
||||
'sub_money' => '下级提成',
|
||||
],
|
||||
'options' => [
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue