(your commit message in past style)

This commit is contained in:
mkm 2024-05-31 17:13:02 +08:00
parent def871cdb5
commit 92224c21ab
16 changed files with 1074 additions and 2 deletions

View File

@ -0,0 +1,95 @@
<?php
namespace app\admin\controller\store_extract;
use app\admin\controller\BaseAdminController;
use app\admin\lists\store_extract\StoreExtractLists;
use app\admin\logic\store_extract\StoreExtractLogic;
use app\admin\validate\store_extract\StoreExtractValidate;
/**
* 门店提现控制器
* Class StoreExtractController
* @package app\admin\controller\store_extract
*/
class StoreExtractController extends BaseAdminController
{
/**
* @notes 获取门店提现列表
* @return \think\response\Json
* @author admin
* @date 2024/05/31 17:09
*/
public function lists()
{
return $this->dataLists(new StoreExtractLists());
}
/**
* @notes 添加门店提现
* @return \think\response\Json
* @author admin
* @date 2024/05/31 17:09
*/
public function add()
{
$params = (new StoreExtractValidate())->post()->goCheck('add');
$result = StoreExtractLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(StoreExtractLogic::getError());
}
/**
* @notes 编辑门店提现
* @return \think\response\Json
* @author admin
* @date 2024/05/31 17:09
*/
public function edit()
{
$params = (new StoreExtractValidate())->post()->goCheck('edit');
$result = StoreExtractLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(StoreExtractLogic::getError());
}
/**
* @notes 删除门店提现
* @return \think\response\Json
* @author admin
* @date 2024/05/31 17:09
*/
public function delete()
{
$params = (new StoreExtractValidate())->post()->goCheck('delete');
StoreExtractLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取门店提现详情
* @return \think\response\Json
* @author admin
* @date 2024/05/31 17:09
*/
public function detail()
{
$params = (new StoreExtractValidate())->goCheck('detail');
$result = StoreExtractLogic::detail($params);
return $this->data($result);
}
}

View File

@ -0,0 +1,95 @@
<?php
namespace app\admin\controller\store_finance_flow;
use app\admin\controller\BaseAdminController;
use app\admin\lists\store_finance_flow\StoreFinanceFlowLists;
use app\admin\logic\store_finance_flow\StoreFinanceFlowLogic;
use app\admin\validate\store_finance_flow\StoreFinanceFlowValidate;
/**
* 门店流水控制器
* Class StoreFinanceFlowController
* @package app\admin\controller\store_finance_flow
*/
class StoreFinanceFlowController extends BaseAdminController
{
/**
* @notes 获取门店流水列表
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:56
*/
public function lists()
{
return $this->dataLists(new StoreFinanceFlowLists());
}
/**
* @notes 添加门店流水
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:56
*/
public function add()
{
$params = (new StoreFinanceFlowValidate())->post()->goCheck('add');
$result = StoreFinanceFlowLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(StoreFinanceFlowLogic::getError());
}
/**
* @notes 编辑门店流水
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:56
*/
public function edit()
{
$params = (new StoreFinanceFlowValidate())->post()->goCheck('edit');
$result = StoreFinanceFlowLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(StoreFinanceFlowLogic::getError());
}
/**
* @notes 删除门店流水
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:56
*/
public function delete()
{
$params = (new StoreFinanceFlowValidate())->post()->goCheck('delete');
StoreFinanceFlowLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取门店流水详情
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:56
*/
public function detail()
{
$params = (new StoreFinanceFlowValidate())->goCheck('detail');
$result = StoreFinanceFlowLogic::detail($params);
return $this->data($result);
}
}

View File

@ -0,0 +1,95 @@
<?php
namespace app\admin\controller\user_bill;
use app\admin\controller\BaseAdminController;
use app\admin\lists\user_bill\UserBillLists;
use app\admin\logic\user_bill\UserBillLogic;
use app\admin\validate\user_bill\UserBillValidate;
/**
* 资金记录控制器
* Class UserBillController
* @package app\admin\controller\user_bill
*/
class UserBillController extends BaseAdminController
{
/**
* @notes 获取资金记录列表
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:44
*/
public function lists()
{
return $this->dataLists(new UserBillLists());
}
/**
* @notes 添加资金记录
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:44
*/
public function add()
{
$params = (new UserBillValidate())->post()->goCheck('add');
$result = UserBillLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(UserBillLogic::getError());
}
/**
* @notes 编辑资金记录
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:44
*/
public function edit()
{
$params = (new UserBillValidate())->post()->goCheck('edit');
$result = UserBillLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(UserBillLogic::getError());
}
/**
* @notes 删除资金记录
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:44
*/
public function delete()
{
$params = (new UserBillValidate())->post()->goCheck('delete');
UserBillLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取资金记录详情
* @return \think\response\Json
* @author admin
* @date 2024/05/31 16:44
*/
public function detail()
{
$params = (new UserBillValidate())->goCheck('detail');
$result = UserBillLogic::detail($params);
return $this->data($result);
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace app\admin\lists\store_extract;
use app\admin\lists\BaseAdminDataLists;
use app\common\model\store_extract\StoreExtract;
use app\common\lists\ListsSearchInterface;
/**
* 门店提现列表
* Class StoreExtractLists
* @package app\admin\listsstore_extract
*/
class StoreExtractLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author admin
* @date 2024/05/31 17:09
*/
public function setSearch(): array
{
return [
'=' => ['store_id', 'extract_type', 'status', 'pay_status', 'create_time'],
];
}
/**
* @notes 获取门店提现列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author admin
* @date 2024/05/31 17:09
*/
public function lists(): array
{
return StoreExtract::where($this->searchWhere)
->field(['id', 'store_id', 'extract_type', 'extract_price', 'mark', 'status', 'pay_status', 'admin_id', 'create_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取门店提现数量
* @return int
* @author admin
* @date 2024/05/31 17:09
*/
public function count(): int
{
return StoreExtract::where($this->searchWhere)->count();
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace app\admin\lists\store_finance_flow;
use app\admin\lists\BaseAdminDataLists;
use app\common\model\store_finance_flow\StoreFinanceFlow;
use app\common\lists\ListsSearchInterface;
/**
* 门店流水列表
* Class StoreFinanceFlowLists
* @package app\admin\listsstore_finance_flow
*/
class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author admin
* @date 2024/05/31 16:56
*/
public function setSearch(): array
{
return [
'=' => ['store_id', 'uid', 'create_time'],
];
}
/**
* @notes 获取门店流水列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author admin
* @date 2024/05/31 16:56
*/
public function lists(): array
{
return StoreFinanceFlow::where($this->searchWhere)
->field(['id', 'uid', 'staff_id', 'order_id', 'link_id', 'type', 'pay_type', 'remark', 'trade_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取门店流水数量
* @return int
* @author admin
* @date 2024/05/31 16:56
*/
public function count(): int
{
return StoreFinanceFlow::where($this->searchWhere)->count();
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace app\admin\lists\user_bill;
use app\admin\lists\BaseAdminDataLists;
use app\common\model\user_bill\UserBill;
use app\common\lists\ListsSearchInterface;
/**
* 资金记录列表
* Class UserBillLists
* @package app\admin\listsuser_bill
*/
class UserBillLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author admin
* @date 2024/05/31 16:44
*/
public function setSearch(): array
{
return [
'=' => ['uid', 'type', 'create_time'],
];
}
/**
* @notes 获取资金记录列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author admin
* @date 2024/05/31 16:44
*/
public function lists(): array
{
return UserBill::where($this->searchWhere)
->field(['id', 'type', 'number', 'mark', 'create_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取资金记录数量
* @return int
* @author admin
* @date 2024/05/31 16:44
*/
public function count(): int
{
return UserBill::where($this->searchWhere)->count();
}
}

View File

@ -0,0 +1,94 @@
<?php
namespace app\admin\logic\store_extract;
use app\common\model\store_extract\StoreExtract;
use app\common\logic\BaseLogic;
use think\facade\Db;
/**
* 门店提现逻辑
* Class StoreExtractLogic
* @package app\admin\logic\store_extract
*/
class StoreExtractLogic extends BaseLogic
{
/**
* @notes 添加门店提现
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 17:09
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
StoreExtract::create([
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑门店提现
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 17:09
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
StoreExtract::where('id', $params['id'])->update([
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除门店提现
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 17:09
*/
public static function delete(array $params): bool
{
return StoreExtract::destroy($params['id']);
}
/**
* @notes 获取门店提现详情
* @param $params
* @return array
* @author admin
* @date 2024/05/31 17:09
*/
public static function detail($params): array
{
return StoreExtract::findOrEmpty($params['id'])->toArray();
}
}

View File

@ -0,0 +1,94 @@
<?php
namespace app\admin\logic\store_finance_flow;
use app\common\model\store_finance_flow\StoreFinanceFlow;
use app\common\logic\BaseLogic;
use think\facade\Db;
/**
* 门店流水逻辑
* Class StoreFinanceFlowLogic
* @package app\admin\logic\store_finance_flow
*/
class StoreFinanceFlowLogic extends BaseLogic
{
/**
* @notes 添加门店流水
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 16:56
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
StoreFinanceFlow::create([
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑门店流水
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 16:56
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
StoreFinanceFlow::where('id', $params['id'])->update([
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除门店流水
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 16:56
*/
public static function delete(array $params): bool
{
return StoreFinanceFlow::destroy($params['id']);
}
/**
* @notes 获取门店流水详情
* @param $params
* @return array
* @author admin
* @date 2024/05/31 16:56
*/
public static function detail($params): array
{
return StoreFinanceFlow::findOrEmpty($params['id'])->toArray();
}
}

View File

@ -34,7 +34,6 @@ class StoreProductUnitLogic extends BaseLogic
'py' => $params['py'],
'number' => $params['number'],
'data' => $params['data'],
'more' => $params['more']
]);
Db::commit();
@ -64,7 +63,6 @@ class StoreProductUnitLogic extends BaseLogic
'py' => $params['py'],
'number' => $params['number'],
'data' => $params['data'],
'more' => $params['more']
]);
Db::commit();

View File

@ -0,0 +1,94 @@
<?php
namespace app\admin\logic\user_bill;
use app\common\model\user_bill\UserBill;
use app\common\logic\BaseLogic;
use think\facade\Db;
/**
* 资金记录逻辑
* Class UserBillLogic
* @package app\admin\logic\user_bill
*/
class UserBillLogic extends BaseLogic
{
/**
* @notes 添加资金记录
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 16:44
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
UserBill::create([
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑资金记录
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 16:44
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
UserBill::where('id', $params['id'])->update([
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除资金记录
* @param array $params
* @return bool
* @author admin
* @date 2024/05/31 16:44
*/
public static function delete(array $params): bool
{
return UserBill::destroy($params['id']);
}
/**
* @notes 获取资金记录详情
* @param $params
* @return array
* @author admin
* @date 2024/05/31 16:44
*/
public static function detail($params): array
{
return UserBill::findOrEmpty($params['id'])->toArray();
}
}

View File

@ -0,0 +1,82 @@
<?php
namespace app\admin\validate\store_extract;
use app\common\validate\BaseValidate;
/**
* 门店提现验证器
* Class StoreExtractValidate
* @package app\admin\validate\store_extract
*/
class StoreExtractValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
];
/**
* @notes 添加场景
* @return StoreExtractValidate
* @author admin
* @date 2024/05/31 17:09
*/
public function sceneAdd()
{
return $this->remove('id', true);
}
/**
* @notes 编辑场景
* @return StoreExtractValidate
* @author admin
* @date 2024/05/31 17:09
*/
public function sceneEdit()
{
return $this->only(['id']);
}
/**
* @notes 删除场景
* @return StoreExtractValidate
* @author admin
* @date 2024/05/31 17:09
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return StoreExtractValidate
* @author admin
* @date 2024/05/31 17:09
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -0,0 +1,82 @@
<?php
namespace app\admin\validate\store_finance_flow;
use app\common\validate\BaseValidate;
/**
* 门店流水验证器
* Class StoreFinanceFlowValidate
* @package app\admin\validate\store_finance_flow
*/
class StoreFinanceFlowValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
];
/**
* @notes 添加场景
* @return StoreFinanceFlowValidate
* @author admin
* @date 2024/05/31 16:56
*/
public function sceneAdd()
{
return $this->remove('id', true);
}
/**
* @notes 编辑场景
* @return StoreFinanceFlowValidate
* @author admin
* @date 2024/05/31 16:56
*/
public function sceneEdit()
{
return $this->only(['id']);
}
/**
* @notes 删除场景
* @return StoreFinanceFlowValidate
* @author admin
* @date 2024/05/31 16:56
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return StoreFinanceFlowValidate
* @author admin
* @date 2024/05/31 16:56
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -0,0 +1,82 @@
<?php
namespace app\admin\validate\user_bill;
use app\common\validate\BaseValidate;
/**
* 资金记录验证器
* Class UserBillValidate
* @package app\admin\validate\user_bill
*/
class UserBillValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
];
/**
* @notes 添加场景
* @return UserBillValidate
* @author admin
* @date 2024/05/31 16:44
*/
public function sceneAdd()
{
return $this->remove('id', true);
}
/**
* @notes 编辑场景
* @return UserBillValidate
* @author admin
* @date 2024/05/31 16:44
*/
public function sceneEdit()
{
return $this->only(['id']);
}
/**
* @notes 删除场景
* @return UserBillValidate
* @author admin
* @date 2024/05/31 16:44
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return UserBillValidate
* @author admin
* @date 2024/05/31 16:44
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace app\common\model\store_extract;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 门店提现模型
* Class StoreExtract
* @package app\common\model\store_extract
*/
class StoreExtract extends BaseModel
{
use SoftDelete;
protected $name = 'store_extract';
protected $deleteTime = 'delete_time';
}

View File

@ -0,0 +1,22 @@
<?php
namespace app\common\model\store_finance_flow;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 门店流水模型
* Class StoreFinanceFlow
* @package app\common\model\store_finance_flow
*/
class StoreFinanceFlow extends BaseModel
{
use SoftDelete;
protected $name = 'store_finance_flow';
protected $deleteTime = 'delete_time';
}

View File

@ -0,0 +1,22 @@
<?php
namespace app\common\model\user_bill;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 资金记录模型
* Class UserBill
* @package app\common\model\user_bill
*/
class UserBill extends BaseModel
{
use SoftDelete;
protected $name = 'user_bill';
protected $deleteTime = 'delete_time';
}