123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- /**
- * Created by PhpStorm.
- * User: XiaoMing
- * Date: 2019/12/16
- * Time: 9:41
- */
- namespace JinDouYun\Controller\Cron;
- use JinDouYun\Dao\Enterprise\DEnterprise;
- use Util\Common\PartnerTools;
- use Util\Common\AgentTools;
- use JinDouYun\Model\Market\MCoupon;
- use Mall\Framework\Core\StatusCode;
- class NewCommissionCron
- {
- //命令:php /www/wwwroot/apiqnys.liuniukj.com/Public/www/index.php -mCron -cNewCommissionCron -anewCommissionTask >> /www/wwwroot/logs/apiqnys.liuniukj.com/cron.log 2>&1 &
-
- public function newCommissionTask(){
- echo PHP_EOL."新佣金计算任务开始".PHP_EOL;
- $objDEnterprise = new DEnterprise();
- $objDEnterprise->setTable('qianniao_enterprise_1');
- $enterpriseList = $objDEnterprise->select(['deleteStatus' => StatusCode::$standard]);
- if (empty($enterpriseList)){
- echo '企业数据为空'.PHP_EOL;
- die;
- }
- foreach ($enterpriseList as $value){
- if(empty($value['id'])) continue;
-
- //合伙人任务
- $taskTotal = new PartnerTools($value['id']);
- $res = $taskTotal->runTask();
- if(empty($res) || empty($res["code"])){
- echo '系统错误'.PHP_EOL;
- }else{
- echo json_encode($res,JSON_UNESCAPED_UNICODE).PHP_EOL;
- }
-
- //门店代理任务
- $taskTotal2 = new AgentTools($value['id']);
- $res2 = $taskTotal2->runTaskNew();
- if(empty($res2) || empty($res2["code"])){
- echo '系统错误'.PHP_EOL;
- }else{
- echo json_encode($res2,JSON_UNESCAPED_UNICODE).PHP_EOL;
- }
- }
- echo '新佣金计算任务结束'.PHP_EOL;
- }
- }
|