Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
d48ee7b613
@ -58,7 +58,7 @@ class FinancialTransfersController extends BaseAdminController
|
|||||||
$result = FinancialTransfersLogic::dealchange($update,$params['id']);
|
$result = FinancialTransfersLogic::dealchange($update,$params['id']);
|
||||||
|
|
||||||
if (true === $result) {
|
if (true === $result) {
|
||||||
return $this->success('转账成功' );
|
return $this->success('转账成功',[],1,1);
|
||||||
}
|
}
|
||||||
return $this->fail(FinancialTransfersLogic::getError());
|
return $this->fail(FinancialTransfersLogic::getError());
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ class ProductController extends BaseApiController{
|
|||||||
*/
|
*/
|
||||||
public function lists(){
|
public function lists(){
|
||||||
|
|
||||||
return $this->dataLists(new ProductLists());
|
return $this->dataLists(new ProductLists(),1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,17 +88,23 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface,Li
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$found){
|
if(!$found){
|
||||||
$this->searchWhere[]=['store_id','=',2];
|
$store_id = DictType::where('type','store')->value('remark')??5;
|
||||||
|
$this->searchWhere[]=['store_id','=',$store_id];
|
||||||
}
|
}
|
||||||
$class_all=$this->request->get('class_all');
|
$class_all=$this->request->get('class_all');
|
||||||
$where=[];
|
$where=[];
|
||||||
if($class_all){
|
if($class_all){
|
||||||
|
//查3级别的
|
||||||
$arr=Cate::where('pid',$class_all)->column('id');
|
$arr=Cate::where('pid',$class_all)->column('id');
|
||||||
if($arr){
|
if($arr){
|
||||||
$arr2=Cate::where('pid','in',$arr)->column('id');
|
$arr2=Cate::where('pid','in',$arr)->column('id');
|
||||||
$where[]=['cate_id','in',array_merge($arr,$arr2)];
|
$where[]=['cate_id','in',array_merge($arr,$arr2)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(empty($where) && $class_all){
|
||||||
|
//2或者1
|
||||||
|
$where[]=['cate_id','=',$class_all];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->searchWhere[]=['status','=',1];
|
$this->searchWhere[]=['status','=',1];
|
||||||
@ -159,7 +165,8 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface,Li
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$found){
|
if(!$found){
|
||||||
$this->searchWhere[]=['store_id','=',2];
|
$store_id = DictType::where('type','store')->value('remark')??5;
|
||||||
|
$this->searchWhere[]=['store_id','=',$store_id];
|
||||||
}
|
}
|
||||||
$class_all=$this->request->get('class_all');
|
$class_all=$this->request->get('class_all');
|
||||||
$where=[];
|
$where=[];
|
||||||
@ -170,6 +177,10 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface,Li
|
|||||||
$where[]=['cate_id','in',array_merge($arr,$arr2)];
|
$where[]=['cate_id','in',array_merge($arr,$arr2)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(empty($where)&& $class_all){
|
||||||
|
//2或者1
|
||||||
|
$where[]=['cate_id','=',$class_all];
|
||||||
|
}
|
||||||
$M_store_id=$this->request->__get('store_id');
|
$M_store_id=$this->request->__get('store_id');
|
||||||
$this->searchWhere[]=['status','=',1];
|
$this->searchWhere[]=['status','=',1];
|
||||||
$this->searchWhere[]=['stock','>',0];
|
$this->searchWhere[]=['stock','>',0];
|
||||||
|
@ -6,6 +6,7 @@ namespace app\api\logic\user;
|
|||||||
use app\common\{logic\BaseLogic,
|
use app\common\{logic\BaseLogic,
|
||||||
model\dict\DictData,
|
model\dict\DictData,
|
||||||
model\finance\CapitalFlow,
|
model\finance\CapitalFlow,
|
||||||
|
model\store_finance_flow\StoreFinanceFlow,
|
||||||
model\store_order\StoreOrder,
|
model\store_order\StoreOrder,
|
||||||
model\system_store\DeliveryService,
|
model\system_store\DeliveryService,
|
||||||
model\system_store\SystemStore,
|
model\system_store\SystemStore,
|
||||||
@ -66,7 +67,8 @@ class UserLogic extends BaseLogic
|
|||||||
public static function info($uid)
|
public static function info($uid)
|
||||||
{
|
{
|
||||||
$data = User::with(['userShip'])->where('id',$uid)
|
$data = User::with(['userShip'])->where('id',$uid)
|
||||||
->field('id,avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship')
|
->field('id,avatar,real_name,nickname,account,mobile,sex,login_ip,now_money,total_recharge_amount,user_ship
|
||||||
|
,purchase_funds')
|
||||||
->find();
|
->find();
|
||||||
//判断是不是员工
|
//判断是不是员工
|
||||||
if($data){
|
if($data){
|
||||||
@ -88,6 +90,10 @@ class UserLogic extends BaseLogic
|
|||||||
$data['store_id'] = $check['store_id'];
|
$data['store_id'] = $check['store_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$data['return_money'] = StoreFinanceFlow::
|
||||||
|
where(['user_id'=>$uid,'status'=>0,'financial_pm'=>0])
|
||||||
|
->sum('number');
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$data = [];
|
$data = [];
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class BaseLikeController extends BaseController
|
|||||||
* @author 令狐冲
|
* @author 令狐冲
|
||||||
* @date 2021/7/8 00:40
|
* @date 2021/7/8 00:40
|
||||||
*/
|
*/
|
||||||
protected function dataLists(BaseDataLists $lists = null)
|
protected function dataLists(BaseDataLists $lists = null,$remark = 0)
|
||||||
{
|
{
|
||||||
//列表类和控制器一一对应,"app/应用/controller/控制器的方法" =》"app\应用\lists\"目录下
|
//列表类和控制器一一对应,"app/应用/controller/控制器的方法" =》"app\应用\lists\"目录下
|
||||||
//(例如:"app/admin/controller/auth/AdminController.php的lists()方法" =》 "app/admin/lists/auth/AminLists.php")
|
//(例如:"app/admin/controller/auth/AdminController.php的lists()方法" =》 "app/admin/lists/auth/AminLists.php")
|
||||||
@ -55,7 +55,7 @@ class BaseLikeController extends BaseController
|
|||||||
// $listName = str_replace('.', '\\', App::getNamespace() . '\\lists\\' . $this->request->controller() . ucwords($this->request->action()));
|
// $listName = str_replace('.', '\\', App::getNamespace() . '\\lists\\' . $this->request->controller() . ucwords($this->request->action()));
|
||||||
// $lists = invoke($listName);
|
// $lists = invoke($listName);
|
||||||
}
|
}
|
||||||
return JsonService::dataLists($lists);
|
return JsonService::dataLists($lists,$remark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,10 +4,13 @@
|
|||||||
namespace app\common\service;
|
namespace app\common\service;
|
||||||
|
|
||||||
|
|
||||||
|
use app\api\logic\store\StoreLogic;
|
||||||
use app\common\enum\ExportEnum;
|
use app\common\enum\ExportEnum;
|
||||||
use app\common\lists\BaseDataLists;
|
use app\common\lists\BaseDataLists;
|
||||||
use app\common\lists\ListsExcelInterface;
|
use app\common\lists\ListsExcelInterface;
|
||||||
use app\common\lists\ListsExtendInterface;
|
use app\common\lists\ListsExtendInterface;
|
||||||
|
use app\common\model\dict\DictType;
|
||||||
|
use app\common\model\system_store\SystemStore;
|
||||||
use support\Response;
|
use support\Response;
|
||||||
use support\exception\BusinessException;
|
use support\exception\BusinessException;
|
||||||
|
|
||||||
@ -90,7 +93,7 @@ class JsonService
|
|||||||
* @author 令狐冲
|
* @author 令狐冲
|
||||||
* @date 2021/7/28 11:15
|
* @date 2021/7/28 11:15
|
||||||
*/
|
*/
|
||||||
public static function dataLists(BaseDataLists $lists)
|
public static function dataLists(BaseDataLists $lists,$remark)
|
||||||
{
|
{
|
||||||
//获取导出信息
|
//获取导出信息
|
||||||
if ($lists->export == ExportEnum::INFO && $lists instanceof ListsExcelInterface) {
|
if ($lists->export == ExportEnum::INFO && $lists instanceof ListsExcelInterface) {
|
||||||
@ -109,6 +112,12 @@ class JsonService
|
|||||||
'page_no' => $lists->pageNo,
|
'page_no' => $lists->pageNo,
|
||||||
'page_size' => $lists->pageSize,
|
'page_size' => $lists->pageSize,
|
||||||
];
|
];
|
||||||
|
$store_id = DictType::where('type','store')->value('remark')??5;
|
||||||
|
if($remark){
|
||||||
|
$data['store'] = StoreLogic::search([
|
||||||
|
'id' => $store_id
|
||||||
|
]);
|
||||||
|
}
|
||||||
$data['extend'] = [];
|
$data['extend'] = [];
|
||||||
if ($lists instanceof ListsExtendInterface) {
|
if ($lists instanceof ListsExtendInterface) {
|
||||||
$data['extend'] = $lists->extend();
|
$data['extend'] = $lists->extend();
|
||||||
|
@ -563,17 +563,33 @@ class WorkbenchLogic extends BaseLogic
|
|||||||
|
|
||||||
//总的营业额的统计 总的利润的统计 总的成本合集的统计 总的加到保证金的
|
//总的营业额的统计 总的利润的统计 总的成本合集的统计 总的加到保证金的
|
||||||
$all = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']]);
|
$all = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']]);
|
||||||
|
|
||||||
|
$deposit_all = SystemStore::where('id',$params['store_id'])
|
||||||
|
->value('paid_deposit');
|
||||||
|
|
||||||
|
$cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
||||||
|
->where('status',YesNoEnum::YES)
|
||||||
|
->sum('receipts');
|
||||||
|
if(isset($params['month']) && $params['month']){
|
||||||
|
$all = StoreOrder::where(['paid'=>YesNoEnum::YES,'store_id'=>$params['store_id']])
|
||||||
|
->whereMonth('create_time', $params['month'])
|
||||||
|
;
|
||||||
|
$deposit_all = SystemStore::where('id',$params['store_id'])
|
||||||
|
->whereMonth('create_time', $params['month'])
|
||||||
|
->value('paid_deposit');
|
||||||
|
$cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
||||||
|
->where('status',YesNoEnum::YES)
|
||||||
|
->whereMonth('create_time', $params['month'])
|
||||||
|
->sum('receipts');
|
||||||
|
}
|
||||||
$turnover_all = $all
|
$turnover_all = $all
|
||||||
->sum('pay_price');
|
->sum('pay_price');
|
||||||
$profit_all = $all
|
$profit_all = $all
|
||||||
->sum('profit');
|
->sum('profit');
|
||||||
$cost_all = $all
|
$cost_all = $all
|
||||||
->sum('cost');
|
->sum('cost');
|
||||||
$deposit_all = SystemStore::where('id',$params['store_id'])
|
|
||||||
->value('paid_deposit');
|
|
||||||
$cash_all = StoreCashFinanceFlow::where('store_id',$params['store_id'])
|
|
||||||
->where('status',YesNoEnum::YES)
|
|
||||||
->sum('receipts');
|
|
||||||
|
|
||||||
|
|
||||||
$time = self::getLastSevenDays();
|
$time = self::getLastSevenDays();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user