| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\jobs;
- use yii\base\BaseObject;
- use yii\queue\JobInterface;
- use app\utils\OrderUtil;
- use app\models\ErpInventory;
- use app\modules\admin\models\erp\InventoryForm;
- // erp库存同步到商品
- class ErpJob extends BaseObject implements JobInterface
- {
- public $in_action;
- public $store_id;
- public $id;
- public $count;
- public $front_agent_admin_id;
- public function execute($queue)
- {
- debug_log(__METHOD__ . '~~~~~~~~已弃用~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
- throw new \Exception(__METHOD__ . '~~~~~~~~已弃用~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
- return;
- $_GET['md_id'] = 0;
- if($this->in_action){
- $action = $this->in_action;
- $this->$action();
- }
- }
- public function executeErpInventory2Goods() {
- try {
- if(cache_lock(__METHOD__ . $this->id, 30)){
- return;
- }
- ErpInventory::num2Goods($this->id);
- } catch (\Exception $e) {
- \Yii::error($e);
- }
- }
- public function executeErpInitStoreGoods() {
- try {
- InventoryForm::initStoreGoods($this->store_id, $this->id, $this->count);
- } catch (\Exception $e) {
- \Yii::error($e);
- }
- }
- public function executeAgentFrontErpInitStoreGoods() {
- try {
- \app\modules\admin\models\agent\front_erp\InventoryForm::initStoreGoods($this->front_agent_admin_id, $this->id, $this->count);
- } catch (\Exception $e) {
- \Yii::error($e);
- }
- }
- }
|