This commit is contained in:
mkm 2024-05-10 18:05:50 +08:00
parent 93b0b92514
commit 4cd3eed06a
4 changed files with 14 additions and 6 deletions

View File

@ -47,14 +47,20 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
// ->each(function ($item) {
->each(function ($item) {
$id=Goodsclass::where('pid',$item['id'])->value('id');
if($id){
$item['is_menu'] = 1;
}else{
$item['is_menu'] = 0;
}
// $a = Goodsclass::where('pid', $item['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select();
// $item['children'] = $a;
// foreach ($a as $k => &$v) {
// $b = Goodsclass::where('pid', $v['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select();
// $v['children'] = $b;
// }
// })
})
->toArray();
return $lists;
// return linear_to_tree($lists, 'children');

View File

@ -9,6 +9,7 @@ use app\common\model\goods\Goods;
use app\common\model\opurchase\OpurchaseGoodsOffer;
use app\common\model\opurchase\Opurchaseinfo;
use app\common\model\supplier\Supplier;
use support\Log;
use think\facade\Db;
@ -154,6 +155,7 @@ class OpurchaseclassLogic extends BaseLogic
}
}catch (\Exception $e){
self::setError($e->getMessage());
Log::error('添加采购订单报价失败:'.$e->getMessage());
return false;
}
}

View File

@ -4,7 +4,7 @@ namespace app\api\controller\order;
use app\api\logic\order\OrderLogic;
use app\api\controller\BaseApiController;
use Webman\RedisQueue\Redis;
/**
* 采购单控制器
@ -31,7 +31,8 @@ class OpurchaseOrderController extends BaseApiController
if($order==false){
return $this->fail(OrderLogic::getError());
}else{
//推送队列
Redis::send('push-supplier-products', ['order_id'=>$order['id']]);
return $this->success('支付成功');
}
}

View File

@ -12,7 +12,7 @@ use support\Log;
class PushSupplierProductsSend implements Consumer
{
// 要消费的队列名
public $queue = 'send-mail';
public $queue = 'push-supplier-products';
// 连接名,对应 plugin/webman/redis-queue/redis.php 里的连接`
public $connection = 'default';
@ -24,7 +24,6 @@ class PushSupplierProductsSend implements Consumer
$select=Opurchaseinfo::where('pid',$order_id)->where('is_push',0)->select();
foreach ($select as $key => $arr) {
OpurchaseclassLogic::createSupplierGoods($arr);
}
}
// 消费失败回调