commit
df8d888499
@ -87,32 +87,16 @@ class StoreBranchProductLogic extends BaseLogic
|
||||
$stock = bcadd($find['stock'], $params['nums'], 2);
|
||||
$branchStock = bcadd($storeBranchProduct['stock'], $params['nums'], 2);
|
||||
|
||||
onBeforeUpdate($storeBranchProduct,'branch_product');
|
||||
StoreBranchProduct::where('id', $params['id'])->update(['stock' => $branchStock, 'total_price' => bcmul($branchStock, $find['purchase'], 2)]);
|
||||
$storeBranchProduct['stock']=$branchStock;
|
||||
$storeBranchProduct['total_price']=bcmul($branchStock, $find['purchase'], 2);
|
||||
onAfterUpdate($storeBranchProduct,'branch_product');
|
||||
StoreBranchProduct::update(['stock' => $branchStock, 'total_price' => bcmul($branchStock, $find['purchase'], 2)],['id'=> $params['id']]);
|
||||
StoreProduct::update(['stock' => $stock, 'total_price' => bcmul($stock, $find['purchase'], 2)],['id'=> $params['product_id']]);
|
||||
|
||||
onBeforeUpdate($find,'product');
|
||||
StoreProduct::where('id', $params['product_id'])->update(['stock' => $stock, 'total_price' => bcmul($stock, $find['purchase'], 2)]);
|
||||
$find['stock']=$stock;
|
||||
$find['total_price']=bcmul($stock, $find['purchase'], 2);
|
||||
onAfterUpdate($find,'product');
|
||||
} else {
|
||||
$branchStock = bcsub($storeBranchProduct['stock'], $params['nums'], 2);
|
||||
$stock = bcsub($find['stock'], $params['nums'], 2);
|
||||
|
||||
onBeforeUpdate($storeBranchProduct,'branch_product');
|
||||
StoreBranchProduct::where('id', $params['id'])->update(['stock' => $branchStock, 'total_price' => bcmul($branchStock, $find['purchase'], 2)]);
|
||||
$storeBranchProduct['stock']=$branchStock;
|
||||
$storeBranchProduct['total_price']=bcmul($branchStock, $find['purchase'], 2);
|
||||
onAfterUpdate($storeBranchProduct,'branch_product');
|
||||
StoreBranchProduct::where('id', $params['id'])->update(['stock' => $branchStock, 'total_price' => bcmul($branchStock, $find['purchase'], 2)],['id'=>$params['id']]);
|
||||
StoreProduct::where('id', $params['product_id'])->update(['stock' => $stock, 'total_price' => bcmul($stock, $find['purchase'], 2)],['id'=>$params['product_id']]);
|
||||
|
||||
onBeforeUpdate($find,'product');
|
||||
StoreProduct::where('id', $params['product_id'])->update(['stock' => $stock, 'total_price' => bcmul($stock, $find['purchase'], 2)]);
|
||||
$find['stock']=$stock;
|
||||
$find['total_price']=bcmul($stock, $find['purchase'], 2);
|
||||
onAfterUpdate($find,'product');
|
||||
}
|
||||
Db::commit();
|
||||
return true;
|
||||
|
@ -46,7 +46,9 @@ class StoreOrderLogic extends BaseLogic
|
||||
$v['uid'] = $params['user_id'];
|
||||
$v['store_id'] = $params['store_id'];
|
||||
$v['cart_num'] = $v['stock'];
|
||||
StoreBranchProduct::where('id', $v['id'])->update(['price' => $v['price'], 'vip_price' => $v['price'], 'cost' => $v['price'], 'purchase' => $v['price']]);
|
||||
if(in_array($params['store_id'],[17,18])){
|
||||
StoreBranchProduct::where('id', $v['id'])->update(['price' => $v['price'], 'vip_price' => $v['price'], 'cost' => $v['price'], 'purchase' => $v['price']]);
|
||||
}
|
||||
unset($v['id']);
|
||||
$res = CartLogic::add($v);
|
||||
$cartId[] = $res['id'];
|
||||
@ -54,6 +56,7 @@ class StoreOrderLogic extends BaseLogic
|
||||
$user = User::where('id', $params['user_id'])->find();
|
||||
$params['shipping_type'] = 2;
|
||||
$params['pay_type'] = 7;
|
||||
$params['source'] =2;
|
||||
$order = OrderLogic::createOrder($cartId, null, $user, $params);
|
||||
return true;
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ class StoreProductLogic extends BaseLogic
|
||||
'is_show' => $params['is_show'] ?? 0,
|
||||
];
|
||||
|
||||
StoreProduct::where('id', $params['id'])->update($data);
|
||||
StoreProduct::update($data,['id'=>$params['id']]);
|
||||
|
||||
// $dealCate = self::dealChangeCate($params['cate_id']);
|
||||
//修改
|
||||
|
@ -42,7 +42,7 @@ class WarehouseProductLogic extends BaseLogic
|
||||
$storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find();
|
||||
if ($storege) {
|
||||
if ($params['financial_pm'] == 0) {
|
||||
$storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty()->toArray();
|
||||
$storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty();
|
||||
if (!$storeProduct) {
|
||||
throw new BusinessException('商品不存在');
|
||||
}
|
||||
@ -52,17 +52,12 @@ class WarehouseProductLogic extends BaseLogic
|
||||
// if ($after_nums < 0) {
|
||||
// throw new BusinessException('库存不足,warehouse_id:'.$params['warehouse_id'].'product_id:'.$params['product_id']);
|
||||
// }
|
||||
onBeforeUpdate($storege->toArray(),'product_storege');
|
||||
WarehouseProductStorege::where('id', $storege['id'])->update(['nums'=>$after_nums, 'total_price' => $total_price]);
|
||||
$storege=$storege->toArray();
|
||||
$storege['nums']=$after_nums;
|
||||
$storege['total_price']=$total_price;
|
||||
onAfterUpdate($storege,'product_storege');
|
||||
WarehouseProductStorege::update(['nums'=>$after_nums, 'total_price' => $total_price],['id'=> $storege['id']]);
|
||||
|
||||
//门店加库存
|
||||
$storeBranchProduct = StoreBranchProduct::where('product_id', $params['product_id'])->where('store_id', $params['store_id'])->find();
|
||||
if (!$storeBranchProduct) {
|
||||
$storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty()->toArray();
|
||||
$storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty();
|
||||
if (!$storeProduct) {
|
||||
throw new BusinessException('商品不存在');
|
||||
}
|
||||
@ -74,34 +69,32 @@ class WarehouseProductLogic extends BaseLogic
|
||||
} else {
|
||||
$after_nums = $storege['nums'] + $params['nums'];
|
||||
if ($type == 1) {
|
||||
$storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty()->toArray();
|
||||
$storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty();
|
||||
if (!$storeProduct) {
|
||||
throw new BusinessException('商品不存在');
|
||||
}
|
||||
$total_price = bcmul($after_nums, $storeProduct['purchase'], 2);
|
||||
onBeforeUpdate($storege->toArray(),'product_storege');
|
||||
WarehouseProductStorege::where('id', $storege['id'])->update(['nums' => $after_nums, 'total_price' => $total_price]);
|
||||
$storege=$storege->toArray();
|
||||
$storege['nums']=$after_nums;
|
||||
$storege['total_price']=$total_price;
|
||||
onAfterUpdate($storege,'product_storege');
|
||||
WarehouseProductStorege::update(['nums' => $after_nums, 'total_price' => $total_price],['id'=>$storege['id']]);
|
||||
}
|
||||
}
|
||||
$before_nums = $storege['nums'];
|
||||
} else {
|
||||
$after_nums = $params['nums'];
|
||||
$storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty()->toArray();
|
||||
$storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty();
|
||||
if (!$storeProduct) {
|
||||
throw new BusinessException('商品不存在');
|
||||
}
|
||||
$total_price = bcmul($after_nums, $storeProduct['purchase'], 2);
|
||||
$storege=WarehouseProductStorege::create([
|
||||
$data=[
|
||||
'warehouse_id' => $params['warehouse_id'],
|
||||
'product_id' => $params['product_id'],
|
||||
'nums' => $params['nums'],
|
||||
'total_price'=>$total_price
|
||||
]);
|
||||
onAfterUpdate($storege->toArray(),'product_storege');
|
||||
];
|
||||
if($params['financial_pm']==0){
|
||||
$data['nums']=-$params['nums'];
|
||||
}
|
||||
$storege=WarehouseProductStorege::create($data);
|
||||
}
|
||||
$batch_count = WarehouseProduct::where(['product_id' => $params['product_id'], 'warehouse_id' => $params['warehouse_id'], 'financial_pm' => $params['financial_pm'], 'store_id' => $params['store_id']])->count();
|
||||
$data = [
|
||||
|
@ -69,6 +69,17 @@ class ProductLists extends BaseApiDataLists implements ListsSearchInterface, Lis
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$store_name=$this->request->get('store_name');
|
||||
if($store_name && $store_name!=''){
|
||||
if (preg_match('/^1234-/',$store_name)) {
|
||||
foreach($this->searchWhere as $k=>$v){
|
||||
if($v[0]=='store_name|bar_code'){
|
||||
unset($this->searchWhere[$k]);
|
||||
$this->searchWhere[$k]=['bar_code','=',$store_name];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$order = $this->request->get('order', '');
|
||||
$field = $this->request->get('field', '');
|
||||
if (empty($order) || empty($field)) {
|
||||
|
@ -183,39 +183,40 @@ class StoreFinanceFlowLogic extends BaseLogic
|
||||
->select();
|
||||
foreach ($list as $k => $value) {
|
||||
//用户
|
||||
switch ($value['type']) {
|
||||
case 0:
|
||||
if ($value['financial_type'] == 12 && $value['other_uid'] > 0) {
|
||||
$user = User::where('id', $value['other_uid'])->findOrEmpty();
|
||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||
$user->now_money = bcsub($user['now_money'], $value['number'], 2);
|
||||
$user->save();
|
||||
// Log::error('aa'.$a);
|
||||
// Log::error('aa'.$user['now_money']);
|
||||
// Log::error('aa'.$value['number']);
|
||||
$capitalFlowDao->userExpense('user_order_promotion_refund', 'system_back', $value['order_id'], $value['number'], '', $value['pay_type']);
|
||||
}
|
||||
break;
|
||||
//商户
|
||||
case 1:
|
||||
$store = SystemStore::where('id', $store_id)->find();
|
||||
$capitalFlowDao = new CapitalFlowLogic($store, 'store');
|
||||
if ($value['number'] > 0 && $value['financial_type'] == 2) {
|
||||
SystemStore::where('id', $value['store_id'])->dec('store_money', $value['number'])->update();
|
||||
$capitalFlowDao->storeExpense('store_paid_deposit_dec', 'order', $value['order_id'],$value['number']);
|
||||
if($value['type']==0){
|
||||
if ($value['financial_type'] == 12 && $value['other_uid'] > 0) {
|
||||
$user = User::where('id', $value['other_uid'])->findOrEmpty();
|
||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||
$user->now_money = bcsub($user['now_money'], $value['number'], 2);
|
||||
$user->save();
|
||||
$capitalFlowDao->userExpense('user_order_promotion_refund', 'system_back', $value['order_id'], $value['number'], '', $value['pay_type']);
|
||||
}
|
||||
}elseif($value['type']==1){
|
||||
$store = SystemStore::where('id', $store_id)->find();
|
||||
$capitalFlowDao = new CapitalFlowLogic($store, 'store');
|
||||
if ($value['number'] > 0 && $value['financial_type'] == 2) {
|
||||
$find=SystemStore::where('id', $value['store_id'])->find();
|
||||
$find->store_money=bcsub($find['store_money'], $value['number'],2);
|
||||
$find->save();
|
||||
$capitalFlowDao->storeExpense('store_money_refund', 'order', $value['order_id'],$value['number'],'','store_money');
|
||||
|
||||
}
|
||||
if ($value['number'] > 0 && $value['financial_type'] == 16) {
|
||||
SystemStore::where('id', $value['store_id'])->dec('attrition', $value['number'])->update();
|
||||
$capitalFlowDao->storeExpense('store_attrition_dec', 'order', $value['order_id'], $value['number']);
|
||||
}
|
||||
if ($value['number'] > 0 && $value['financial_type'] == 16) {
|
||||
$find=SystemStore::where('id', $value['store_id'])->find();
|
||||
$find->attrition=bcsub($find['attrition'], $value['number'],2);
|
||||
$find->save();
|
||||
$capitalFlowDao->storeExpense('store_attrition_refund', 'order', $value['order_id'], $value['number'],'','attrition');
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$find = StoreFinanceFlow::where('order_sn', $orderSn)->where('financial_type', 11)->where('status', 1)->find();
|
||||
if ($find && $find['number'] > 0) {
|
||||
SystemStore::where('id', $find['store_id'])->dec('paid_deposit', $find['number'])->update();
|
||||
$find=SystemStore::where('id', $value['store_id'])->find();
|
||||
$capitalFlowDao = new CapitalFlowLogic($find, 'store');
|
||||
$find->paid_deposit=bcsub($find['paid_deposit'], $value['number'],2);
|
||||
$find->save();
|
||||
$capitalFlowDao->storeExpense('store_paid_deposit_refund', 'order', $value['order_id'],$value['number'],'','paid_deposit');
|
||||
}
|
||||
// $data = StoreFinanceFlow::where('order_sn', $orderSn)->select();
|
||||
// foreach ($data as $k => &$value) {
|
||||
|
@ -7,8 +7,9 @@ use app\common\model\BaseModel;
|
||||
use app\common\model\store_category\StoreCategory;
|
||||
use app\common\model\store_product\StoreProduct;
|
||||
use app\common\model\store_product_unit\StoreProductUnit;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 门店商品属性值辅助表模型
|
||||
@ -40,4 +41,13 @@ class StoreBranchProduct extends BaseModel
|
||||
{
|
||||
return $this->hasOne(StoreProduct::class,'id','product_id');
|
||||
}
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'branch_product','更新前');
|
||||
channelLog($data->toArray(),'branch_product','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('branch_product:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -7,8 +7,9 @@ use app\common\model\BaseModel;
|
||||
use app\common\model\system_store\SystemStore;
|
||||
use app\common\model\system_store\SystemStoreStaff;
|
||||
use app\common\model\user\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 门店流水模型
|
||||
@ -36,4 +37,12 @@ class StoreFinanceFlow extends BaseModel
|
||||
return $this->hasOne(SystemStoreStaff::class, 'id', 'staff_id')->bind(['staff_name']);
|
||||
}
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'store_finance_flow','更新前');
|
||||
channelLog($data->toArray(),'store_finance_flow','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('store_finance_flow:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,9 @@ namespace app\common\model\store_finance_flow_product;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 财务流水商品明细
|
||||
@ -17,4 +18,13 @@ class StoreFinanceFlowProduct extends BaseModel
|
||||
use SoftDelete;
|
||||
protected $name = 'store_finance_flow_product';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'store_finance_flow_product','更新前');
|
||||
channelLog($data->toArray(),'store_finance_flow_product','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('store_finance_flow_product:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ use app\common\model\system_store\SystemStoreStaff;
|
||||
use app\common\model\user\User;
|
||||
use support\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 订单列表模型
|
||||
@ -100,4 +100,13 @@ class StoreOrder extends BaseModel
|
||||
})->field("FROM_UNIXTIME(create_time,'$timeType') as days,$str as num")
|
||||
->group('days')->select()->toArray();
|
||||
}
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'store_order','更新前');
|
||||
channelLog($data->toArray(),'store_order','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('store_order:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ namespace app\common\model\store_order_cart_info;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\store_branch_product\StoreBranchProduct;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
use Throwable;
|
||||
|
||||
class StoreOrderCartInfo extends BaseModel
|
||||
{
|
||||
@ -18,4 +20,13 @@ class StoreOrderCartInfo extends BaseModel
|
||||
{
|
||||
return $this->hasOne(StoreBranchProduct::class,'id','product_id')->bind(['store_name','image','unit','price']);
|
||||
}
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'store_order_cart_info','更新前');
|
||||
channelLog($data->toArray(),'store_order_cart_info','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('store_order_cart_info:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use app\common\model\store_category\StoreCategory;
|
||||
use app\common\model\store_product_unit\StoreProductUnit;
|
||||
use support\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 商品列表模型
|
||||
@ -33,4 +33,13 @@ class StoreProduct extends BaseModel
|
||||
return $this->hasOne(StoreCategory::class,'id','cate_id')->bind(['class_name'=>'name']);
|
||||
|
||||
}
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'product','更新前');
|
||||
channelLog($data->toArray(),'product','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('product:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -4,8 +4,9 @@ namespace app\common\model\system_store;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 门店列表模型
|
||||
@ -18,5 +19,12 @@ class SystemStore extends BaseModel
|
||||
protected $name = 'system_store';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'system_store','更新前');
|
||||
channelLog($data->toArray(),'system_store','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('system_store:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@ use app\common\model\user_ship\UserShip;
|
||||
use app\common\service\FileService;
|
||||
use support\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 用户模型
|
||||
@ -196,4 +197,12 @@ class User extends BaseModel
|
||||
})->field("FROM_UNIXTIME($create_time,'$timeType') as days,count(id) as num")->group('days')->select()->toArray();
|
||||
}
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'user','更新前');
|
||||
channelLog($data->toArray(),'user','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('user:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,9 @@ namespace app\common\model\warehouse_product;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 商品仓储信息模型
|
||||
@ -18,5 +19,12 @@ class WarehouseProduct extends BaseModel
|
||||
protected $name = 'warehouse_product';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
public static function onAfterWrite($data){
|
||||
try{
|
||||
channelLog($data->getOrigin(),'warehouse_product','更新前');
|
||||
channelLog($data->toArray(),'warehouse_product','更新后');
|
||||
}catch(Throwable $e){
|
||||
Log::error('warehouse_product:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ namespace app\common\model\warehouse_product_storege;
|
||||
use app\common\model\BaseModel;
|
||||
use support\Log;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 仓库商品存储
|
||||
@ -18,5 +18,13 @@ class WarehouseProductStorege extends BaseModel
|
||||
use SoftDelete;
|
||||
protected $name = 'warehouse_product_storege';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
}
|
||||
public static function onAfterWrite($data)
|
||||
{
|
||||
try {
|
||||
channelLog($data->getOrigin(), 'warehouse_product_storege', '更新前');
|
||||
channelLog($data->toArray(), 'warehouse_product_storege', '更新后');
|
||||
} catch (Throwable $e) {
|
||||
Log::error('warehouse_product_storege:' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
154
config/log.php
154
config/log.php
@ -53,7 +53,7 @@ return [
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/product/'.date('Ym').'/.log',
|
||||
runtime_path() . '/product/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
@ -77,7 +77,7 @@ return [
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/branch_product/'.date('Ym').'/.log',
|
||||
runtime_path() . '/branch_product/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
@ -101,7 +101,7 @@ return [
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/product_storege/'.date('Ym').'/.log',
|
||||
runtime_path() . '/product_storege/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
@ -125,7 +125,7 @@ return [
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/user/'.date('Ym').'/.log',
|
||||
runtime_path() . '/user/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
@ -149,7 +149,151 @@ return [
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/system_store/'.date('Ym').'/.log',
|
||||
runtime_path() . '/system_store/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
0755
|
||||
],
|
||||
// 格式相关
|
||||
'formatter' => [
|
||||
// 格式化处理类的名字
|
||||
'class' => Monolog\Formatter\LineFormatter::class,
|
||||
// 格式化处理类的构造函数参数
|
||||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
'store_finance_flow' => [
|
||||
// 处理默认通道的handler,可以设置多个
|
||||
'handlers' => [
|
||||
[
|
||||
// handler类的名字
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/store_finance_flow/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
0755
|
||||
],
|
||||
// 格式相关
|
||||
'formatter' => [
|
||||
// 格式化处理类的名字
|
||||
'class' => Monolog\Formatter\LineFormatter::class,
|
||||
// 格式化处理类的构造函数参数
|
||||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
'store_finance_flow_product' => [
|
||||
// 处理默认通道的handler,可以设置多个
|
||||
'handlers' => [
|
||||
[
|
||||
// handler类的名字
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/store_finance_flow_product/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
0755
|
||||
],
|
||||
// 格式相关
|
||||
'formatter' => [
|
||||
// 格式化处理类的名字
|
||||
'class' => Monolog\Formatter\LineFormatter::class,
|
||||
// 格式化处理类的构造函数参数
|
||||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
'store_order' => [
|
||||
// 处理默认通道的handler,可以设置多个
|
||||
'handlers' => [
|
||||
[
|
||||
// handler类的名字
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/store_order/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
0755
|
||||
],
|
||||
// 格式相关
|
||||
'formatter' => [
|
||||
// 格式化处理类的名字
|
||||
'class' => Monolog\Formatter\LineFormatter::class,
|
||||
// 格式化处理类的构造函数参数
|
||||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
'store_order_cart_info' => [
|
||||
// 处理默认通道的handler,可以设置多个
|
||||
'handlers' => [
|
||||
[
|
||||
// handler类的名字
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/store_order_cart_info/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
0755
|
||||
],
|
||||
// 格式相关
|
||||
'formatter' => [
|
||||
// 格式化处理类的名字
|
||||
'class' => Monolog\Formatter\LineFormatter::class,
|
||||
// 格式化处理类的构造函数参数
|
||||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
'warehouse_product' => [
|
||||
// 处理默认通道的handler,可以设置多个
|
||||
'handlers' => [
|
||||
[
|
||||
// handler类的名字
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/warehouse_product/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
0755
|
||||
],
|
||||
// 格式相关
|
||||
'formatter' => [
|
||||
// 格式化处理类的名字
|
||||
'class' => Monolog\Formatter\LineFormatter::class,
|
||||
// 格式化处理类的构造函数参数
|
||||
'constructor' => [null, 'Y-m-d H:i:s', true],
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
'warehouse_product_storege' => [
|
||||
// 处理默认通道的handler,可以设置多个
|
||||
'handlers' => [
|
||||
[
|
||||
// handler类的名字
|
||||
'class' => Monolog\Handler\RotatingFileHandler::class,
|
||||
// handler类的构造函数参数
|
||||
'constructor' => [
|
||||
runtime_path() . '/warehouse_product_storege/' . date('Ym') . '/.log',
|
||||
2048,
|
||||
Monolog\Logger::DEBUG,
|
||||
true,
|
||||
|
@ -23,7 +23,7 @@ class Task
|
||||
new Crontab('0 */10 * * * *', function () {
|
||||
$where = ['paid' => 0];
|
||||
$where[] = ['create_time', '<', time() - 600]; // 10分钟前创建的订单
|
||||
$where[] = ['shipping_type', '<>',4];
|
||||
$where[] = ['source', '<',2];
|
||||
// 删除10分钟未支付的订单
|
||||
$oid = StoreOrder::where($where)->column('id'); // 删除时间设置为当前时间,即删除
|
||||
if ($oid) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user