feat(store_cash_finance_flow): 修改添加和删除方法,优化查询列表

This commit is contained in:
mkm 2024-06-06 11:10:58 +08:00
parent 98fb4d087c
commit 48a54fcf5a
3 changed files with 10 additions and 9 deletions

View File

@ -38,12 +38,12 @@ class StoreCashFinanceFlowController extends BaseAdminController
*/ */
public function add() public function add()
{ {
$params = (new StoreCashFinanceFlowValidate())->post()->goCheck('add'); // $params = (new StoreCashFinanceFlowValidate())->post()->goCheck('add');
$result = StoreCashFinanceFlowLogic::add($params); // $result = StoreCashFinanceFlowLogic::add($params);
if (true === $result) { // if (true === $result) {
return $this->success('添加成功', [], 1, 1); return $this->success('添加成功', [], 1, 1);
} // }
return $this->fail(StoreCashFinanceFlowLogic::getError()); // return $this->fail(StoreCashFinanceFlowLogic::getError());
} }
@ -72,8 +72,8 @@ class StoreCashFinanceFlowController extends BaseAdminController
*/ */
public function delete() public function delete()
{ {
$params = (new StoreCashFinanceFlowValidate())->post()->goCheck('delete'); // $params = (new StoreCashFinanceFlowValidate())->post()->goCheck('delete');
StoreCashFinanceFlowLogic::delete($params); // StoreCashFinanceFlowLogic::delete($params);
return $this->success('删除成功', [], 1, 1); return $this->success('删除成功', [], 1, 1);
} }

View File

@ -26,7 +26,8 @@ class StoreCashFinanceFlowLists extends BaseAdminDataLists implements ListsSearc
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['store_id', 'create_time'], '=' => ['store_id'],
"between_time" => 'create_time'
]; ];
} }

View File

@ -65,7 +65,7 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
->select()->each(function ($item) { ->select()->each(function ($item) {
$item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : ''; $item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : '';
$item['status_name'] = OrderEnum::getOrderType($item['status']) ?? ''; $item['status_name'] = OrderEnum::getOrderType($item['status']) ?? '';
for($i=0;$i<3;$i++){ for($i=0;$i<count($item['product'])&&$i<3;$i++){
$find= StoreBranchProduct::where('id',$item['product'][$i]['product_id'])->field('store_name,image')->find(); $find= StoreBranchProduct::where('id',$item['product'][$i]['product_id'])->field('store_name,image')->find();
$item['product'][$i]['store_name']=$find['store_name']; $item['product'][$i]['store_name']=$find['store_name'];
$item['product'][$i]['image']=$find['image']; $item['product'][$i]['image']=$find['image'];