PHP code example of buoly / waimai

1. Go to this page and download the library: Download buoly/waimai library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

buoly / waimai example snippets




use Waimai\Waimai;

$config = [

    'meituan' => [
        'app_id' => '****',
        'secret' => '********************************',
    ],
    
    'jd' => [
        'app_id' => '****',
        'secret' => '********************************',
    ],
    
    'debug' => true,
    
    'log' => [
        'name' => 'waimai',
        'file' => __DIR__.'/logs/waimai.log',
    ],
    
];

$jd = Waimai::JD($config);

$mt = Waimai::Meituan($config);



$params = array(
// 参数
);

$shop_jd = $jd->shop;

$shop_mt = $mt->shop;


$result1 = $shop_jd->save($params);

$result2 = $shop_mt->save($params);