更新
This commit is contained in:
parent
93b0b92514
commit
4cd3eed06a
@ -47,14 +47,20 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()
|
->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();
|
// $a = Goodsclass::where('pid', $item['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select();
|
||||||
// $item['children'] = $a;
|
// $item['children'] = $a;
|
||||||
// foreach ($a as $k => &$v) {
|
// foreach ($a as $k => &$v) {
|
||||||
// $b = Goodsclass::where('pid', $v['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select();
|
// $b = Goodsclass::where('pid', $v['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select();
|
||||||
// $v['children'] = $b;
|
// $v['children'] = $b;
|
||||||
// }
|
// }
|
||||||
// })
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
return $lists;
|
return $lists;
|
||||||
// return linear_to_tree($lists, 'children');
|
// return linear_to_tree($lists, 'children');
|
||||||
|
@ -9,6 +9,7 @@ use app\common\model\goods\Goods;
|
|||||||
use app\common\model\opurchase\OpurchaseGoodsOffer;
|
use app\common\model\opurchase\OpurchaseGoodsOffer;
|
||||||
use app\common\model\opurchase\Opurchaseinfo;
|
use app\common\model\opurchase\Opurchaseinfo;
|
||||||
use app\common\model\supplier\Supplier;
|
use app\common\model\supplier\Supplier;
|
||||||
|
use support\Log;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
|
||||||
|
|
||||||
@ -154,6 +155,7 @@ class OpurchaseclassLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
}catch (\Exception $e){
|
}catch (\Exception $e){
|
||||||
self::setError($e->getMessage());
|
self::setError($e->getMessage());
|
||||||
|
Log::error('添加采购订单报价失败:'.$e->getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ namespace app\api\controller\order;
|
|||||||
|
|
||||||
use app\api\logic\order\OrderLogic;
|
use app\api\logic\order\OrderLogic;
|
||||||
use app\api\controller\BaseApiController;
|
use app\api\controller\BaseApiController;
|
||||||
|
use Webman\RedisQueue\Redis;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购单控制器
|
* 采购单控制器
|
||||||
@ -31,7 +31,8 @@ class OpurchaseOrderController extends BaseApiController
|
|||||||
if($order==false){
|
if($order==false){
|
||||||
return $this->fail(OrderLogic::getError());
|
return $this->fail(OrderLogic::getError());
|
||||||
}else{
|
}else{
|
||||||
|
//推送队列
|
||||||
|
Redis::send('push-supplier-products', ['order_id'=>$order['id']]);
|
||||||
return $this->success('支付成功');
|
return $this->success('支付成功');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ use support\Log;
|
|||||||
class PushSupplierProductsSend implements Consumer
|
class PushSupplierProductsSend implements Consumer
|
||||||
{
|
{
|
||||||
// 要消费的队列名
|
// 要消费的队列名
|
||||||
public $queue = 'send-mail';
|
public $queue = 'push-supplier-products';
|
||||||
|
|
||||||
// 连接名,对应 plugin/webman/redis-queue/redis.php 里的连接`
|
// 连接名,对应 plugin/webman/redis-queue/redis.php 里的连接`
|
||||||
public $connection = 'default';
|
public $connection = 'default';
|
||||||
@ -24,7 +24,6 @@ class PushSupplierProductsSend implements Consumer
|
|||||||
$select=Opurchaseinfo::where('pid',$order_id)->where('is_push',0)->select();
|
$select=Opurchaseinfo::where('pid',$order_id)->where('is_push',0)->select();
|
||||||
foreach ($select as $key => $arr) {
|
foreach ($select as $key => $arr) {
|
||||||
OpurchaseclassLogic::createSupplierGoods($arr);
|
OpurchaseclassLogic::createSupplierGoods($arr);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 消费失败回调
|
// 消费失败回调
|
||||||
|
Loading…
x
Reference in New Issue
Block a user